Pyinstaller 安装报错,有大佬帮忙看看吗?

2019-09-18 09:22:41 +08:00
 nanhuier
用的是 py2.7,pip 版本 19.2.3, 使用命令
pip install pyinstaller
报错如下:

Collecting pyinstaller
Using cached https://files.pythonhosted.org/packages/e2/c9/0b44b2ea87ba36395483a672fddd07e6a9cb2b8d3c4a28d7ae76c7e7e1e5/PyInstaller-3.5.tar.gz
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\3540004\appdata\local\temp\pip-build-env-gshins\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (12 lines):
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "c:\python27\lib\site-packages\pip\__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "c:\python27\lib\site-packages\pip\_internal\__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "c:\python27\lib\site-packages\pip\_vendor\urllib3\__init__.py", line 25, in <module>
from logging import NullHandler
ImportError: cannot import name NullHandler
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\3540004\appdata\local\temp\pip-build-env-gshins\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.

请问有大佬碰到过吗
5264 次点击
所在节点    Python
3 条回复
arrow8899
2019-09-18 09:32:03 +08:00
https://www.google.com/search?q=cannot+import+name+NullHandler
善用搜索引擎,第一条就是答案
delectate
2019-09-18 09:33:07 +08:00
The NullHandler is only available on Python version 2.7+. You could create the NullHandler yourself on an ImportError:

import logging

try:
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass

logging.getLogger(__name__).addHandler(NullHandler())


https://stackoverflow.com/questions/26939308/importerror-cannot-import-name-nullhandler
cwjokaka
2019-09-18 09:42:25 +08:00
遇到 pip 相关的问题,如果解决不了,我都会重建一个 venv

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/601703

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX