我试图在我的机器上安装python3.6后,我目前有python3.4。然而,安装后尝试下python3.6运行pip给我的错误:在ubuntu中将python3.4升级到python3.6中断pip
Traceback (most recent call last):
File "pip3", line 7, in
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 59, in
from pip.log import logger
File "/usr/lib/python3/dist-packages/pip/log.py", line 9, in
import colorama, pkg_resources
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1520, in
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 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "pip3", line 7, in
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 59, in
from pip.log import logger
File "/usr/lib/python3/dist-packages/pip/log.py", line 9, in
import colorama, pkg_resources
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1520, in
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
大约有所遇到的错误在互联网上的一些意见,但是,他们没有包含任何实际的解决方案建议。有没有人有任何想法我可以解决这个问题?
+0
没有一个解决方案,但我建议使用pyenv管理在一台机器不同的Python安装。 –
+0
执行此操作:'pip install -U pip setuptools' –