Findlay Smith Findlay Smith - 26 days ago 12
Python Question

How do you specify which python distribution to install a module for with pip?

I am trying to install the yweather module for python 3.5 on my mac using pip install, however as i have both python 3.5 and 2.7 i don't know how to specify which distribution to install the module for - how would you do this?

Answer

pip will install a module for the default python on your system. If you want to be sure that pip installs for a specific version, use pip2 or pip3 instead of pip.

Also if you aren't already, you should consider using virtual environments.