C:\Users\user>pip install pyinstaller
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pyinstaller
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3c/c9/c3f9bc64eb11eee6a824686deba6129884c8cbdf70e750661773b9865ee0/PyInstaller-3.6.tar.gz (3.5 MB)
|████████████████████████████████| 3.5 MB 2.2 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "d:\python安装\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "d:\python安装\lib\site-packages\pip\_internal\commands\install.py", line 331, in run
resolver.resolve(requirement_set)
File "d:\python安装\lib\site-packages\pip\_internal\legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "d:\python安装\lib\site-packages\pip\_internal\legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "d:\python安装\lib\site-packages\pip\_internal\legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "d:\python安装\lib\site-packages\pip\_internal\operations\prepare.py", line 516, in prepare_linked_requirement
req, self.req_tracker, self.finder, self.build_isolation,
File "d:\python安装\lib\site-packages\pip\_internal\operations\prepare.py", line 95, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "d:\python安装\lib\site-packages\pip\_internal\distributions\sdist.py", line 38, in prepare_distribution_metadata
self._setup_isolation(finder)
File "d:\python安装\lib\site-packages\pip\_internal\distributions\sdist.py", line 96, in _setup_isolation
reqs = backend.get_requires_for_build_wheel()
File "d:\python安装\lib\site-packages\pip\_vendor\pep517\wrappers.py", line 152, in get_requires_for_build_wheel
'config_settings': config_settings
File "d:\python安装\lib\site-packages\pip\_vendor\pep517\wrappers.py", line 255, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pep517.wrappers.BackendUnavailable: Traceback (most recent call last):
File "d:\python安装\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 63, in _build_backend
obj = import_module(mod_path)
File "d:\python安装\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'setuptools.build_meta'
一开始是python下载就有的pip安装网站,老是安装第三方库出现毛病,后来询问老师之后转用了清华的镜像网(也许是叫这个),那就神速了。。(也没有那么夸张)
But,安装pyinstaller又有毛病了
翻了许多博文,看到一个很强的文章,太强了。。。
先更新
>pip install --upgrade setuptools
然后安装pyinstaller发现还是不能安装
creating 'C:\Users\user\Local\Temp\pip-modern-metadata-x2uj4w42\PyInstaller.dist-info'
error: invalid command 'bdist_wheel'
总是出现这样那样的问题
于是安装wheel
>pip install wheel
然后再pip install pyinstaller
就。。。。。成功了。。。hhhhh
大佬总结的出现问题的原因,膜拜大佬
出现的原因(触发以下所有条件):
正在使用virtualenv(虚拟环境)与–system-site-packages
使用的 pip 版本 >= 19.0.2
setuptools包版本低于40.8.0。
安装的软件包未在build-backend="setuptools.build_meta"中指定pyproject.toml。
————————————————
<版权声明:本文为CSDN博主「机智豪SAMA」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_43849588/article/details/89464031>