How to set default python version for pip?

OS: Mac OS X 10.11.3

I have Python 2.7.10 and Python 3.4.3.

When I pip install some_package pip installs the package for Python 2.7.10, but I want to install the package for Python 3.4.3.

How can I install Python by default or install a package for 3.4.3?

+5
source share
2 answers

As with python / python3 , pip also has two options. You can use pip3 to install Python 3 packages.

+4
source

You can install the pip package using a virtual environment:

 virtualenv -p /usr/bin/python3 py3env source py3env/bin/activate pip install package-name 
+1
source

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


All Articles