Ubuntu focus fossa python3 錯誤 - 每個人都會發生這個錯誤嗎?

Ubuntu focus fossa python3 錯誤 - 每個人都會發生這個錯誤嗎?

這個錯誤是每個人都會發生嗎?

  1. 安裝 Ubuntu Focal Fossa。

  2. 然後安裝python3-pip(此時Python3已自動安裝)

    Python 3.8.10 (default, Jun  2 2021, 10:49:15)
    [GCC 9.4.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    
  3. 建立使用者名稱並進行設定後:

    sudo python3
    >>> help()
    help> modules
    

現在,在這個階段您將遇到錯誤訊息。

Error: Could not import kivy. Please install it using the instructions mentioned here `https://kivy.org/#download` .

重點是如果不使用 sudo 就不會出現此錯誤。

python3
>>> help()
help> modules

答案1

Error: Could not import kivy. Please install it using the instructions mentioned here https://kivy.org/#download在相同情況下,您收到的錯誤訊息可以在 Ubuntu 中重現。 python3指令modules需要一段時間才能運行並產生大量結果,其中可能包含有關非 root 使用者安裝的文件的信息,因此出於安全原因,您不應在 root python3 shell 中運行此命令。該python3命令通常由普通用戶運行,並且您不應該以 root 身份運行 python3。

相關內容