安装pyinstaller会显示错误消息

时间:2019-01-24 09:38:50

标签: python

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条命令来完成的。

5 个答案:

答案 0 :(得分:4)

这是由issue in pip 19引起的。目前唯一的解决方法是降级到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

答案 1 :(得分:2)

确切的问题:

  

获取要求构建轮...错误

由菲利普Belemezov答案是为我工作。下面是该问题的重现和屏幕截图形式的工作解决方案,供您更好地理解。

Issue

解决方案

  1. pip install pip==18.1-以管理员身份运行命令提示符,它将为您安装pip版本18.1,如下所示。

pip install 18.1

  1. pip install pyinstaller-现在运行此命令,它将安装module:pyinstaller,如下所示。

command to install the pyinstaller

  1. 最后一步是在命令中键入pyinstaller,如果输出相似,则意味着您已经成功安装了package:pyinstaller。

pyinstaller installed successfully

答案 2 :(得分:2)

我遇到了同样的问题并尝试了很多从互联网上获得的方法,但以下对我有用

  1. 以管理员身份打开命令提示符
  2. 将 pip 降级到 18.1 版 pip install pip==18.1
  3. 下载 pyinstaller 3.4 版 pip install pyinstaller==3.4
  4. 成功,这应该可行。使用 pyinstaller -v
  5. 验证安装

答案 3 :(得分:0)

降级 pip 对我也不起作用。从 conda 安装运行良好。 尝试 - 'conda install -c conda-forge pyinstaller'

答案 4 :(得分:-2)

安装PyInstaller的简便方法是使用pip:

pip install pyinstaller

或升级到新版本:

pip install --upgrade pyinstaller

要安装当前的开发版本,请使用:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz