我已经安装了python3.8,并从源代码中安装了python3.4。
我想要pip==19.1.1,因为python3.4支持它。在安装pip之后,当我尝试更改它的版本时,它显示的是不同的版本,您可以在附加的映像中看到。
有没有办法在19.1.1版中使用pip?
提前谢谢你。
remus@remus-VirtualBox:~$ python3.4 --version
Python 3.4.0
remus@remus-VirtualBox:~$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (20.0.2-5ubuntu1.6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
remus@remus-VirtualBox:~$ pip install pip==19.1.1
Collecting pip==19.1.1
Using cached pip-19.1.1-py2.py3-none-any.whl (1.4 MB)
Installing collected packages: pip
WARNING: The scripts pip, pip3 and pip3.8 are installed in '/home/remus/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-19.1.1
remus@remus-VirtualBox:~$ pip -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)操作系统: UBUNTU 20.04.4(焦点)
发布于 2022-06-29 16:07:41
我强烈建议使用像文夫或康达这样的工具来创建您的环境。这将使您不得不区分机器上的多个python二进制文件的麻烦。
尽管如此,我认为您的问题可以通过显式使用正确的python版本来解决,方法是启动这样的pip:
python3.4 -m pip --version例如,我安装了两个不同的python版本(真丢人!)这是我得到的输出:
generic@motorbrot:~$ python --version
Python 2.7.17
generic@motorbrot:~$ python -m pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
generic@motorbrot:~$ python3 --version
Python 3.6.9
generic@motorbrot:~$ python3 -m pip --version
pip 21.1.2 from /home/generic/.local/lib/python3.6/site-packages/pip (python 3.6)https://stackoverflow.com/questions/72804481
复制相似问题