Shawn Zamperini
Shawn Zamperini

Reputation: 37

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. 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?

Upvotes: 0

Views: 42

Answers (2)

phd
phd

Reputation: 94473

I would assume that pip3 and pip3.6 would want to say something like 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 #!).

Open the scripts in your editor and fix the shebang lines. Something like that:

vim $(which pip3.6)

Upvotes: 0

DevOps
DevOps

Reputation: 384

pip is bundled with python > 3.4 so,if you're on a Unix machine try:

python3.6 -m pip install [Package_to_install]

or if you're on a Windows machine

py -m pip install [Package_to_install]

I hope this is what you meant..

Upvotes: 3

Related Questions