How can I tell pip that I'm interested in packages for python 3.4?

After an hour of searching, I did not find the answer.

My Mac came with Python 2.7, but I decided to upgrade to python 3.4.

  • I installed python 3.4 from python.org.
  • Now I can use python 3.4 from the terminal.
  • Pip is still trying to download python 2.7 packages - numpy for 2.7 is "up to date".
  • When I try to --upgrade a package, for example numpy, I get a "no permission" error. When sudo is added, the output is garbage.

How can I tell pip that I'm interested in packages for python 3.4?

Requirement already up-to-date: numpy in /Library/Python/2.7/site-packages 

This is problem. I want numpy to be updated with Python 3.4.

+6
source share
3 answers

You should be able to call a specific item for your installation, although it depends on which version you are using:

Starting from version 0.8:

 pip-3.4 install numpy 

and starting with version 1.5:

 pip3.4 install numpy 

If you do not have them, you can just download pip and reinstall it, just be sure to call python 3.4 when the installer starts.

0
source

I would suggest installing a package manager like macports brew and install an updated version of python from them. After installing the latest python version, use pip to install the numpy version

On mac ports, you can choose the default system python without getting confused with your path.

+1
source

I would use Homebrew :

 brew install python3 

This should install Python3.4.1. Then, to get pip:

 curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py sudo python3 get-pip.py # Upgrade just in case... pip3 install -U pip 

Then use:

 pip3 install numpy 

And to run Python use:

 python3 

(I only have one installation of Python 3, if you have several, you will need to be more specific with the version number)

+1
source

Source: https://habr.com/ru/post/970354/


All Articles