无法在 python 2 上安装 pyinstaller


pip2 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: /usr/bin/python2 /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpXfz8sO            
cwd: /tmp/pip-install-VoIwF7/pyinstaller                                                                                                              
Complete output (4 lines):                                                                                                                                 
Traceback (most recent call last):                                                                                                                         
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 16, in <module>                                                    
from importlib import import_module                                                                                                                    
ImportError: No module named importlib                                                                                                                     
----------------------------------------                                                                                                                   
ERROR: Command errored out with exit status 1: /usr/bin/python2 /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpXfz8sO Check the logs for full command output.

在windows和linux上都无法在python 2上安装pyinstaller。说出类似的错误。我需要编译一个用python 2编写的代码。有人出现同样的错误吗?请帮助

pyinstaller的最新版本不支持Python 2.7,如需求中所述。

要使Python 2.7正常工作,必须安装3.6版本。

首先,你应该升级你的python版本,在这里你导入的是没有安装的包,所以首先使用pip-install-importlib 安装

最新更新