python3.5升级到python3.7后,pip3不能用了。
Tofloor
poster avatar
yyslush
deepin
2019-12-23 23:24
Author
python3.5升级到python3.7后,pip3不能用了。卸载、重装都无法解决pip3的问题。
yyslush@yyslush-PC:~$ pip3 --version
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in
    from pip import main
ImportError: cannot import name 'main' from 'pip' (/usr/local/lib/python3.7/site-packages/pip/__init__.py)


Reply Favorite View the author
All Replies
avatar
Feng Yu
deepin
2019-12-24 00:02
#1
你这么升级的搞法压根是错误的方式,只是pip不能用还是轻的,估计很多依赖Python3的系统服务都没法 正常工作,不要作死,建议重装系统恢复。

正确的姿势是使用Anaconda/Miniconda无污染的方式,不干扰系统Python,无需root提权
Reply View the author
avatar
yyslush
deepin
2019-12-24 00:07
#2
搞定了,是链接出错。
方法:
rm /usr/bin/pip3
sudo ln -s /usr/local/bin/pip /usr/bin/pip
Reply View the author
avatar
ritter
deepin
2019-12-24 03:23
#3
python依赖已经被破坏了,你慢慢的就会发现有很多软件就莫名其妙打不开了。。。
Reply View the author
avatar
yyslush
deepin
2019-12-24 16:19
#4
我又回到python3.5了。
Reply View the author