繁体   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