我正在嘗試在 Wine 中安裝 Python 包,但它不斷給我內部語法錯誤。當我嘗試安裝 pyinstaller 時,它給了我這個:
C:\>pip install pyinstaller
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
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\jackpy\temp\tmpo_ofkx'
cwd: c:\users\jackpy\temp\pip-install-tjtlkl\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\jackpy\temp\pip-build-env-wvrvge\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\jackpy\temp\pip-build-env-wvrvge\overlay\Lib\site-packages\setuptools\build_meta.py", line 127, in _get_build_requires
self.run_setup()
File "c:\users\jackpy\temp\pip-build-env-wvrvge\overlay\Lib\site-packages\setuptools\build_meta.py", line 243, in run_setup
self).run_setup(setup_script=setup_script)
File "c:\users\jackpy\temp\pip-build-env-wvrvge\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\jackpy\temp\tmpo_ofkx' Check the logs for full command output.
我曾嘗試使用 get-pip.py 卸載并重新安裝,但始終是相同的錯誤。
我正在使用 Python 2.7.18 和 Wine 4.0。誰能告訴我如何解決這個問題?
uj5u.com熱心網友回復:
據我從 pyinstaller 網站上看到,他們已經從 4.0 版中洗掉了對 python2.7 的支持,而您正在嘗試安裝 4.1.0 版(https://pyinstaller.readthedocs.io/en/stable/)
Finally, this version drops support for Python 2.7, which is end-of-life since January 2020.. The minimum required version is now Python 3.6.
此外,我在 PyPI 上看不到任何其他可用版本,因此您唯一的選擇是將您的 python 至少升級到 3.6 版。
祝你好運!
uj5u.com熱心網友回復:
如果絕對需要使用 Python 2.7,使用最后一個支持的版本應該仍然有效。請嘗試
pip install pyinstaller==3.6
另請參閱:如何使用 pip 降級 pyinstaller?
uj5u.com熱心網友回復:
- 獲取更新版本的 python。你的版本太舊了
- 最近我經歷了這個問題,不像你的,但有點。我洗掉了與 pyinstaller 相關的每個檔案。并給了它一個新的開始
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/446318.html
標籤:Python linux python-2.7 点子 葡萄酒
