Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jcf20010

macrumors newbie
Original poster
Aug 14, 2010
22
1
In Mojave the default installation of Python is Python 2.7.
I installed Python 3.x and the installation put some stuff in the Applications folder and /user/local/bin. If I start a python script with the shebang
Code:
#!/usr/local/bin/python3
it used Python 3 as expected. But when I try to use pip to load a module I get this error

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement urllib (from versions: none)
ERROR: No matching distribution found for urllib

How do I get pip to recognize the Python 3 stuff?
 

casperes1996

macrumors 604
Jan 26, 2014
7,556
5,737
Horsens, Denmark
In Mojave the default installation of Python is Python 2.7.
I installed Python 3.x and the installation put some stuff in the Applications folder and /user/local/bin. If I start a python script with the shebang
Code:
#!/usr/local/bin/python3
it used Python 3 as expected. But when I try to use pip to load a module I get this error



How do I get pip to recognize the Python 3 stuff?

Use pip3. - That's the way it works with home-brew installations at least. You can alias pip to pip3 as well or to the full path of the utility
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.