【发布时间】:2020-08-12 21:50:06
【问题描述】:
在使用pip3 install socketio为python安装socketio包时,我得到了以下结果:
ERROR: launchpadlib 1.10.13 requires testresources, which is not installed.
WARNING: The scripts easy_install and easy_install-3.8 are installed in '/home/bill/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed netifaces-0.10.6 setuptools-3.3 socketio-0.2.1
虽然我能够成功import socketio,但 pip3 似乎已损坏(?)。
具体来说,当尝试在终端中运行包括 pip3 在内的任何内容时,甚至是 pip3 本身,我都会遇到同样的错误:
Traceback (most recent call last):
File "/usr/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/home/<username>/.local/lib/python3.8/site-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 144, in apport_excepthook
with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_pip3.1000.crash'
Original exception was:
Traceback (most recent call last):
File "/usr/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/home/<username>/.local/lib/python3.8/site-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
我尝试重新安装 pip3,但没有帮助。我从 ubuntu 迁移到 mint 认为发行版有问题,但结果相同。当我尝试删除 python 并重新安装它时,我也损坏了 ubuntu,因为我无法使用 pip,但是,你知道他们说什么,生活和学习。 编辑:using pip3: module "importlib._bootstrap" has no attribute "SourceFileLoader" 上的任何内容都不适合我。
我目前使用的是 linux mint 20,但我在 ubuntu 20.04 和 20.04.1 上遇到了同样的问题。
任何想法都将不胜感激!
【问题讨论】:
-
pip和python版本一样吗?你有 python 环境吗?以前?
-
你想安装python-socketio,因为socketio不是官方包(虽然它是does not appear to be malicious,它只是依赖于一个旧的和损坏的setuptools版本)。
标签: python linux python-3.8