简体   繁体   English

为不同版本的python升级pip

[英]Upgrading pip for different versions of python

I have two versions of python installed on my computer (3.6 and 3.7).我的计算机上安装了两个版本的 python(3.6 和 3.7)。 Just upgraded pip to the latest version (19.0.1) using the command python -m pip install --upgrade pip however i think it only upgraded the pip for python version 3.6.刚刚使用命令python -m pip install --upgrade pip --upgrade pip 将 pip 升级到最新版本(19.0.1),但是我认为它只升级了 python 3.6 版的 pip。 When attempting to install a package specifically for python version 3.7 with the following command pip3.7 install scipy i got the message saying You are using pip version 18.1, however version 19.0.1 is available.当尝试使用以下命令pip3.7 install scipy专门为 python 3.7 版pip3.7 install scipy我收到消息说You are using pip version 18.1, however version 19.0.1 is available. Clearly only the pip for version 3.6 was upgraded.显然只有 3.6 版的 pip 升级了。 I cannot figure out a command to upgrade 3.7 pip as well.我也想不出升级 3.7 pip 的命令。 I tried the following:我尝试了以下方法:

python -m pip3.7 install --upgrade pip

This did not work (Trying to use the logic of how packages are handled for different versions of python).这不起作用(尝试使用不同版本的python处理包的逻辑)。 Could not find a question that addressed this specific issue.找不到解决此特定问题的问题。 Any help would be greatly appreciated.任何帮助将不胜感激。

Use the python 3.7 interpreter to run the command:使用 python 3.7 解释器运行命令:

python3.7 -m pip install --upgrade pip

Or use the pip3.7 binary directly:或者直接使用 pip3.7 二进制文件:

pip3.7 install --upgrade pip

export LD_LIBRARY_PATH=/usr/lib64导出 LD_LIBRARY_PATH=/usr/lib64

activate pip3激活pip3

I ran into the same problem.我遇到了同样的问题。 If you have Microsoft Visual also installed the best command to use is如果您还安装了 Microsoft Visual,最好使用的命令是

    py -m pip install --upgrade pip --user

I used that command, and it worked like a charm.我使用了那个命令,它就像一个魅力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM