美文网首页
ubuntu14.04及更低版本安装pip3

ubuntu14.04及更低版本安装pip3

作者: 微凉_半夏 | 来源:发表于2018-07-20 11:18 被阅读0次

在更低的ubuntu版本下不能使用 apt-get install python3-pip安装否则会以下报错:

Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 252, in find_requirement
for page in self._get_pages(locations, req):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 387, in _get_pages
page = self._get_page(location, req)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_page
session=self.session,
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 670, in get_page
resp = session.get(url, headers={"Accept": "text/html"})

应当使用:
1.安装pip:
wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
sudo python3 get-pip.py
2.建立软连接
ln -s /usr/local/bin/pip3 /usr/bin/pip3

注:如已经使用了apt-get install安装先卸载,再重新操作以上命令

卸载命令: sudo apt-get remove python3-pip

相关文章

网友评论

      本文标题:ubuntu14.04及更低版本安装pip3

      本文链接:https://www.haomeiwen.com/subject/llpfmftx.html