簡體   English   中英

我無法安裝 Pyinstaller

[英]I can't install Pyinstaller

當我嘗試執行“pip install pyinstaller”時,出現此錯誤(Python 39)

    ERROR: Command errored out with exit status 1:
     command: 'c:\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\kaito\\AppData\\Local\\Temp\\pip-install-x1uajlp_\\pefile\\setup.py'"'"'; __file__='"'"'C:\\Users\\kaito\\AppData\\Local\\Temp\\pip-install-x1uajlp_\\pefile\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\kaito\AppData\Local\Temp\pip-record-i794i3gc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python39\Include\pefile'
         cwd: C:\Users\kaito\AppData\Local\Temp\pip-install-x1uajlp_\pefile\
    Complete output (14 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib
    copying pefile.py -> build\lib
    copying peutils.py -> build\lib
    creating build\lib\ordlookup
    copying ordlookup\oleaut32.py -> build\lib\ordlookup
    copying ordlookup\ws2_32.py -> build\lib\ordlookup
    copying ordlookup\__init__.py -> build\lib\ordlookup
    running install_lib
    byte-compiling c:\python39\Lib\site-packages\pefile.py to pefile.cpython-39.pyc
    error: [Errno 13] Permission denied: 'c:\\python39\\Lib\\site-packages\\__pycache__\\pefile.cpython-39.pyc.2747580017328'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\kaito\\AppData\\Local\\Temp\\pip-install-x1uajlp_\\pefile\\setup.py'"'"'; __file__='"'"'C:\\Users\\kaito\\AppData\\Local\\Temp\\pip-install-x1uajlp_\\pefile\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\kaito\AppData\Local\Temp\pip-record-i794i3gc\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python39\Include\pefile' Check the logs for full command output.

我似乎無法解決這個問題,請幫助!

好吧,錯誤很明顯,您無權訪問您嘗試安裝 pip package 的文件夾。

使用命令pip install --user pyinstaller

如果這不起作用:

創建一個 virtualenv 並在其中安裝 package:

  1. 打開一個終端。
  2. 使用命令cd Go 到您的項目文件夾
  3. 使用命令virtualenv venv創建虛擬環境
  4. 使用命令\venv\Scripts\activate.bat激活虛擬環境
  5. 激活虛擬環境后,您將擁有一個有權創建/編輯/刪除文件的虛擬環境。 因此,您可以使用命令pip install pyinstaller

您可能還想通過右鍵單擊下面路徑中的文件夾來檢查文件權限。

c:\python39\Lib\site-packages\

還有一個相關的帖子,您可能想要查看。 它可以讓您了解哪里出了問題。

你的錯誤是:

error: [Errno 13] Permission denied:

這可能是因為您不是計算機上的管理員用戶。 您可以切換到管理員帳戶或以管理員身份運行終端/命令提示符(右鍵單擊命令提示符 select “以管理員身份運行”)

以管理員身份運行 cmd。 Select 在 UAC window 中是。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM