1. 安装 pip3 来作为 python3 的包管理工具
apt install python3-pip
2. 升级 pip3
安装完 pip3 后最好升级一下:pip3 install --upgrade pip
3. 升级完 pip3 之后使用 pip3 -V 查看版本出现如下错误:
root@:~# pip3 -V
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
修改 /usr/bin/ 文件夹下的 pip3 文件:
#!/usr/bin/python3
# GENERATED BY DEBIAN
import sys
# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
from pip import main
if __name__ == '__main__':
sys.exit(main())
改为:
#!/usr/bin/python3
# GENERATED BY DEBIAN
import sys
# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
from pip import main
if __name__ == '__main__':
sys.exit(__main__._main())
4.