将pip3指向python3.5而不是python3.6

时间:2019-03-18 16:11:35

标签: pip ubuntu-16.04 python-3.6 python-3.5

我最近通过在Ubuntu 16.04 LTS系统上使用python3.6构建pip(3.6)。

wget https://bootstrap.pypa.io/get-pip.py
python3.6 get-pip.py

此操作成功完成,但将/usr/local/bin/pip3下的pip3二进制文件更改为与/usr/local/lib/python3.6/dist-packages/pip (python 3.6)相对应的/usr/local/lib/python3.5/dist-packages/pip (python 3.5)

我尝试过

sudo update-alternatives --install /usr/local/bin/pip3 pip3 /usr/local/lib/python3.5/dist-packages/pip 1

使sudo update-alternatives --config pip3工作并最终指向python3.5 dist-packages。

我遇到的错误,

update-alternatives: warning: forcing reinstallation of alternative /usr/local/lib/python3.5/dist-packages/pip because link group pip3 is broken
update-alternatives: warning: not replacing /usr/local/bin/pip3 with a link

请咨询,谢谢。

1 个答案:

答案 0 :(得分:0)

将pip3指向python3.5而不是python3.6

python3.5 $(which pip3) install <your-package-name>