0

MacBook Pro already had one python 3.8.2 installation. Then I installed anaconda which has python 3.8.5 and installed python 3.9.4 from python.org.

Pip3 is installing packages to anaconda, not for 3.9.4. How to install packages for python 3.9.4 using pip3 from the terminal? Also, how to run python 3.8.2, 3.8.5, 3.9.4 separately from the terminal (along with their respective idle)?

I am not familiar with changing paths, so detailed commands will be very helpful.

(base) ~ % where python3
/Users/user/opt/anaconda3/bin/python3
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
/usr/local/bin/python3
/usr/bin/python3
(base) ~ % where pip3
/Users/user/opt/anaconda3/bin/pip3
/Library/Frameworks/Python.framework/Versions/3.9/bin/pip3
/usr/local/bin/pip3
/usr/bin/pip3
(base) ~ % where python
/Users/user/opt/anaconda3/bin/python
/usr/bin/python
(base) ~ % where pip
/Users/user/opt/anaconda3/bin/pip

user247534
  • 103
  • 8

1 Answers1

1

Don't use pip3. Use pip3.8 or pip3.9 or start pip with an explicit python.

pythonx-m pip install package

where pythonx is python3.9 or python3.8. I suspect that python3.8 still starts 3.8.2, but to be sure, just enter python3.8 on the command line and look at startup line. I don't know anything about starting Anaconda python.

Similarly, python3.x -m idlelib` will start IDLE with whatever python3.x starts.

Terry Jan Reedy
  • 18,414
  • 3
  • 40
  • 52
  • Any way to use the native Python 3.8.2? `Python3.8` opens the Python3.8.5 installed using anaconda. – user247534 Apr 09 '21 at 04:11
  • On Windows, `py -3.8` should open only python.org installs, but I cannot answer for using Terminal on Mac. If you can find the 3.8.2 folder in Finder, it should contain the 3.8.2 binary, but that does not get you pip, etc. – Terry Jan Reedy Apr 10 '21 at 06:59