【问题标题】:Error in installing pip package auto-py-to-exe安装 pip 包 auto-py-to-exe 时出错
【发布时间】:2021-01-08 07:15:48
【问题描述】:

我正在尝试安装 auto-py-to-exe。事实上,我安装了它,但几个月前,我重新安装了我的 Windows 10。在那之后,我一直在尝试安装 auto-py-to-exe。每当我在命令提示符下键入pip install auto-py-to-exe 时,就会出现此输出

Collecting auto-py-to-exe
  Using cached auto_py_to_exe-2.7.11-py2.py3-none-any.whl (75 kB)
Collecting Eel==0.12.4
  Using cached Eel-0.12.4.tar.gz (15 kB)
Collecting pyinstaller>=4.1
  Using cached pyinstaller-4.1.tar.gz (3.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting bottle
  Using cached bottle-0.12.19-py3-none-any.whl (89 kB)
Collecting bottle-websocket
  Using cached bottle-websocket-0.2.9.tar.gz (2.0 kB)
Collecting future
  Using cached future-0.18.2.tar.gz (829 kB)
Collecting whichcraft
  Using cached whichcraft-0.6.1-py2.py3-none-any.whl (5.2 kB)
Collecting pyinstaller-hooks-contrib>=2020.6
  Using cached pyinstaller_hooks_contrib-2020.11-py2.py3-none-any.whl (172 kB)
Collecting altgraph
  Using cached altgraph-0.17-py2.py3-none-any.whl (21 kB)
Requirement already satisfied: setuptools in c:\users\mniza\appdata\local\programs\python\python39\lib\site-packages (from pyinstaller>=4.1->auto-py-to-exe) (49.2.1)
Collecting pywin32-ctypes>=0.2.0; sys_platform == "win32"
  Using cached pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB)
Collecting pefile>=2017.8.1; sys_platform == "win32"
  Using cached pefile-2019.4.18.tar.gz (62 kB)
Collecting gevent-websocket
  Using cached gevent_websocket-0.10.1-py3-none-any.whl (22 kB)
Collecting gevent
  Using cached gevent-20.12.1.tar.gz (5.9 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\mniza\appdata\local\programs\python\python39\python.exe' 'c:\users\mniza\appdata\local\programs\python\python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\mniza\AppData\Local\Temp\pip-build-env-hh9ixh_9\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 40.8.0' wheel 'Cython >= 3.0a5' 'cffi >= 1.12.3 ; platform_python_implementation == '"'"'CPython'"'"'' 'greenlet >= 0.4.17, < 2.0 ; platform_python_implementation == '"'"'CPython'"'"''
       cwd: None
  Complete output (29 lines):
  Collecting setuptools>=40.8.0
    Using cached setuptools-51.1.1-py3-none-any.whl (2.0 MB)
  Collecting wheel
    Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Collecting Cython>=3.0a5
    Using cached Cython-3.0a6-py2.py3-none-any.whl (1.0 MB)
  Collecting cffi>=1.12.3
    Using cached cffi-1.14.4-cp39-cp39-win_amd64.whl (179 kB)
  Collecting greenlet<2.0,>=0.4.17
    Using cached greenlet-0.4.17.tar.gz (61 kB)
  Collecting pycparser
    Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
  Using legacy 'setup.py install' for greenlet, since package 'wheel' is not installed.
  Installing collected packages: setuptools, wheel, Cython, pycparser, cffi, greenlet
      Running setup.py install for greenlet: started
      Running setup.py install for greenlet: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: 'c:\users\mniza\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mniza\\AppData\\Local\\Temp\\pip-install-c3p25el7\\greenlet\\setup.py'"'"'; __file__='"'"'C:\\Users\\mniza\\AppData\\Local\\Temp\\pip-install-c3p25el7\\greenlet\\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\mniza\AppData\Local\Temp\pip-record-sq3sf8sv\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\mniza\AppData\Local\Temp\pip-build-env-hh9ixh_9\overlay' --compile --install-headers 'C:\Users\mniza\AppData\Local\Temp\pip-build-env-hh9ixh_9\overlay\Include\greenlet'
           cwd: C:\Users\mniza\AppData\Local\Temp\pip-install-c3p25el7\greenlet\
      Complete output (5 lines):
      running install
      running build
      running build_ext
      building 'greenlet' extension
      error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
      ----------------------------------------
  ERROR: Command errored out with exit status 1: 'c:\users\mniza\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mniza\\AppData\\Local\\Temp\\pip-install-c3p25el7\\greenlet\\setup.py'"'"'; __file__='"'"'C:\\Users\\mniza\\AppData\\Local\\Temp\\pip-install-c3p25el7\\greenlet\\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\mniza\AppData\Local\Temp\pip-record-sq3sf8sv\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\mniza\AppData\Local\Temp\pip-build-env-hh9ixh_9\overlay' --compile --install-headers 'C:\Users\mniza\AppData\Local\Temp\pip-build-env-hh9ixh_9\overlay\Include\greenlet' Check the logs for full command output.
  WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
  You should consider upgrading via the 'c:\users\mniza\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\mniza\appdata\local\programs\python\python39\python.exe' 'c:\users\mniza\appdata\local\programs\python\python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\mniza\AppData\Local\Temp\pip-build-env-hh9ixh_9\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 40.8.0' wheel 'Cython >= 3.0a5' 'cffi >= 1.12.3 ; platform_python_implementation == '"'"'CPython'"'"'' 'greenlet >= 0.4.17, < 2.0 ; platform_python_implementation == '"'"'CPython'"'"'' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the 'c:\users\mniza\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.

我认为 Microsoft Visual C++ 有问题,正如我在错误中看到的那样 error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

但是当我尝试安装 Microsoft Visual C++ 时,我看到了这个窗口 error in installing Microsoft Visual C++ 14.0 (picture)

我再次检查了程序列表,我有点困惑应该卸载哪个,应该保留哪个program list (picture)。总的来说,我在这个问题上停留了三个多星期,如果有人能解决这个问题,我将不胜感激。

【问题讨论】:

  • 试试 python -m pip install auto-py-to-exe --user
  • 降级到 Python 3.8,greenlet 还没有包含 3.9 的已编译扩展的包。
  • 或者从lfd.uci.edu/~gohlke/pythonlibs下载greenlet并手动安装。
  • 我尝试下载greenlet,但又出现了一些错误。顺便说一句,我使用的是 python 3.9.0。我应该更改我的 python 版本吗?

标签: python python-3.x windows pip auto-py-to-exe


【解决方案1】:

最后,我发现了问题所在。首先我必须从https://www.lfd.uci.edu/~gohlke/pythonlibs/#greenlet 安装一个合适的greenlet 轮文件。然后在wheel文件的目录下打开命令提示符。然后输入 pip install (filename) 之后,再次从https://www.lfd.uci.edu/~gohlke/pythonlibs/#gevent下载gevent的wheel文件。和之前一样在 wheel 文件的目录中打开命令提示符并再次输入pip install (filename)。 在所有这些之后,输入pip install auto-py-to-exe

希望这对你有用,对我有用!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-16
    • 1970-01-01
    • 2021-11-04
    • 1970-01-01
    • 2021-06-05
    • 1970-01-01
    • 2021-04-20
    相关资源
    最近更新 更多