安装pyinstaller报错

新手上路,请多包涵
C:\Windows\system32>pip install pyinstaller
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pyinstaller
  Using cached https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  Complete output from command c:\python27\python.exe c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py get_requires_for_build_wheel c:\users\goldp\appdata\local\temp\tmpz9mkmy:
  Traceback (most recent call last):
    File "c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py", line 207, in <module>
      main()
    File "c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "c:\users\user\appdata\local\temp\pip-build-env-oljevt\overlay\Lib\site-packages\setuptools\build_meta.py", line 115, in get_requires_for_build_wheel
      return _get_build_requires(config_settings, requirements=['wheel'])
    File "c:\users\user\appdata\local\temp\pip-build-env-oljevt\overlay\Lib\site-packages\setuptools\build_meta.py", line 101, in _get_build_requires
      _run_setup()
    File "c:\users\user\appdata\local\temp\pip-build-env-oljevt\overlay\Lib\site-packages\setuptools\build_meta.py", line 85, in _run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 20, in <module>
      from PyInstaller import __version__ as version, HOMEPATH, PLATFORM
  ImportError: No module named PyInstaller

 Command "c:\python27\python.exe c:\python27\lib\site-packages\pip_vendor\pep517_in_process.py get_requires_for_build_wheel c:\users\user\appdata\local\temp\tmpz9mkmy" failed with error code 1 in c:\users\user\appdata\local\temp\pip-install-yd3kml\pyinstaller

这是我收到的特定错误消息。我不确定这是为什么?这是使用 pip install pyinstaller 和下面建议的所有 3 个命令。

原文由 goldpill 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 700
1 个回答

这是由 pip 19 中的问题 引起的。目前唯一的解决办法是降级到 pip 18.1:

 $ pip install pip==18.1
 $ pip --version
pip 18.1 from ...\lib\site-packages\pip (python 3.7)

然后就可以安装pyinstaller 3.4了:

 $ pip install pyinstaller
Collecting pyinstaller
  Using cached https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz
[...]
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
[...]
Successfully built pyinstaller
Installing collected packages: pyinstaller
Successfully installed pyinstaller-3.4

原文由 VoodooBoot 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Stack Overflow 翻译
子站问答
访问
宣传栏