我使用python2.7.18轮更新,pip也。但我还是会犯同样的错误。在相同版本的linux上,但是在windows上会出现一个错误。如何纠正此错误?
Collecting pyinstaller
Using cached pyinstaller-4.1.tar.gz (3.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Python27\python.exe' 'C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\vinchi\appdata\local\temp\tmpbzv06v'
cwd: c:\users\vinchi\appdata\local\temp\pip-install-x1nttk\pyinstaller
Complete output (19 lines):
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
main()
File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "c:\users\vinchi\appdata\local\temp\pip-build-env-avmgyd\overlay\Lib\site-packages\setuptools\build_meta.py", line 146, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "c:\users\vinchi\appdata\local\temp\pip-build-env-avmgyd\overlay\Lib\site-packages\setuptools\build_meta.py", line 127, in _get_build_requires
self.run_setup()
File "c:\users\vinchi\appdata\local\temp\pip-build-env-avmgyd\overlay\Lib\site-packages\setuptools\build_meta.py", line 243, in run_setup
self).run_setup(setup_script=setup_script)
File "c:\users\vinchi\appdata\local\temp\pip-build-env-avmgyd\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 63
file=sys.stderr)
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python27\python.exe' 'C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\vinchi\appdata\local\temp\tmpbzv06v' Check the logs for full command output.发布于 2022-03-23 04:37:36
在python3中,有许多不同的更改可能使pyinstaller上的新版本无法在python2上工作。要解决这个问题,您必须执行以下操作之一:
。
pip install pyinstaller==3.6我还强烈建议不要使用python 2,因为它已经到了生命的尽头,而且大多数人都使用python 3。对于少数使用python 2的人,他们这么做是因为他们好奇,想运行一些旧代码,或者将旧程序移植到python 3中。(如果您想为python3安装installed,并且安装了两个python版本)
pip3 install pyinstaller这将告诉程序,您使用的是python 3的pip,而不是python 2。我希望这会有所帮助!
https://stackoverflow.com/questions/71578495
复制相似问题