简体   繁体   English

每个版本的pip都会安装python2.7版本的软件包

[英]Every version of pip installs python2.7 version of packages

If I want to download a newer version of a python3 package, it seems like pip, pip3, and pip3.6 all download the python2 version anyways. 如果我想下载python3软件包的较新版本,则pip,pip3和pip3.6似乎都下载了python2版本。 When I check version of each pip, I get the following: 当我检查每个点的版本时,我得到以下信息:

    $ pip -V
    pip 9.0.2 from /usr/local/lib/python2.7/dist-packages (python 2.7) 
    $ pip3 -V
    pip 9.0.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)
    $ pip3.6 -V
    pip 9.0.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)

I would assume that pip3 and pip3.6 would want to say something like python 3.6? 我假设pip3和pip3.6想说类似python 3.6的东西?

pip is bundled with python > 3.4 so,if you're on a Unix machine try: pip与python> 3.4捆绑在一起,因此,如果您在Unix计算机上,请尝试:

python3.6 -m pip install [Package_to_install]

or if you're on a Windows machine 或者如果您使用的是Windows计算机

py -m pip install [Package_to_install]

I hope this is what you meant.. 我希望这就是你的意思。

I would assume that pip3 and pip3.6 would want to say something like python 3.6? 我假设pip3和pip3.6想说类似python 3.6的东西?

They must be, but it's not magic, it's the shebang line (the first line of the script, it starts with #! ). 它们必须是,但这不是魔术,而是shebang行(脚本的第一行,它以#!开头)。

Open the scripts in your editor and fix the shebang lines. 在编辑器中打开脚本并修复shebang行。 Something like that: 像这样:

vim $(which pip3.6)

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

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