4

When I type python3 --version in terminal it shows Python 3.6.0.

When I type in pip --version it shows

pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)

How do I get it from Python/2.7 to Python/3.6?

8
  • 5
    What about pip3 --version? Commented May 15, 2017 at 19:33
  • pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (python 3.6) Commented May 15, 2017 at 19:34
  • 1
    So, you have pip already installed. Commented May 15, 2017 at 19:34
  • I was basically watching a Django tutorial by Derek Banas and he said that it should show Python/3.x Version when I type in pip --version Commented May 15, 2017 at 19:35
  • 1
    You just need to use pip3 instead of pip for Python 3.6.0. Commented May 15, 2017 at 19:37

3 Answers 3

10

From Python 3.4 pip is baked into standard Python. You can use it like,

python3 -m pip install SomePackage

as mentioned in the Python Docs.

Sign up to request clarification or add additional context in comments.

1 Comment

This worked for me and I was able to install the requests package for python3 by doing python3 -m pip install requests on Mac.
1

The guaranteed cross-platform way to run a module 'mod' with a particular python version 'pythonx' is

pythonx -m mod

On Windows, with the py launcher, I might run any of

py -2.7 -m pip
py -3.5 -m pip
py -3.6 -m pip

There is then no question which python and pip combination I will get. Other systems with one 2.x and 3.x version installed can use

python2 -m pip
python3 -m pip

Comments

0

Mac OS X 10.8+ come with Python 2.7 installed by default. This is why when you try to see what your pip version is, it comes back with 9.0.1 from Python 2.7. You shouldn't ever uninstall or move the system-installed Python because it's used internally by the Mac OS and other third-party developers, but a quick workaround is to just use pip3 in place of pip.

A helpful resource on using Python 3 with Mac OS X can be found in the Python docs.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.