PIP不显示正确的版本
我已经安装了Python3.8,并且从其源代码安装了Python3.4。
我想要pip == 19.1.1,因为它在python3.4中得到了支持。在我尝试更改其版本时安装PIP后,但是如您在附件图像中所看到的那样,它显示出不同的版本。
有没有一种方法将PIP与版本19.1.1一起使用?
先感谢您。
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)
os:ubuntu 20.04.4(focal)
I already had python3.8 installed and I installed python3.4 from its source code.
I wanted pip==19.1.1 as it is supported in python3.4. After installing pip when I tried changing its version but it was showing different version as you can see in the attached image.
Is there a way to use pip with version 19.1.1?
Thank you in advance.
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)
OS: UBUNTU 20.04.4(Focal)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我强烈建议使用 venv 或 conda 创建您的环境。这将使您不得不区分机器上的多个Python二进制文件。
也就是说,我认为您的问题可以通过使用正确的PIP启动PIP明确使用正确的Python版本来解决:
例如,我安装了两个不同的Python版本(对我感到羞耻!),这是我获得的输出:
I strongly recommend to use something like venv or conda to create your environments. That would allow you the hassle of having to distinguish multiple python binaries on your machine.
That said, I think your issue can be resolved by explicitly using the right python version by launching pip like this:
For example, I have two different python versions installed (shame on me!) and this is the output I get: