0

Running the below.

PyCharm shows:

% python -V
Python 2.7.16

% where python
bash: where: command not found

whereas in Terminal it shows:

% python -V
Python 3.8.12

% where python
/Users/ryo/opt/anaconda3/bin/python

Why is the PyCharm terminal using a different version of Python compared to my iOS Terminal? Any direction would be appreciated - I've Googled this extensively and searched through StackOverflow but this apparently simple problem is beyond me.

Not sure if it has anything to do with my PATH variable but pasted below for reference:

Mac Terminal

$PATH
/Users/ryo/opt/anaconda3/bin:/Users/ryo/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Terminal Shell Path

The interpreter looks like this.

enter image description here

LazyOne
  • 158,824
  • 45
  • 388
  • 391
fixer
  • 1
  • 2
  • 1
    If you have a virtual environment set up in your PyCharm project, the PyCharm terminal will automatically activate it. That could give you a different version of Python. – Wolf Feb 09 '22 at 11:32
  • Thank you - creating a new virtual environment fixed it! – fixer Feb 11 '22 at 03:24

1 Answers1

1

PyCharm as a convenience will set your terminal python to the project interpreter you have in your settings. You can change it by going to Settings -> Project: <project name> -> Python Interpreter

possum
  • 1,837
  • 3
  • 9
  • 18
  • The Python interpreter I have selected (3.10) does not match either the Mac Terminal nor the Pycharm Terminal. – fixer Feb 10 '22 at 09:34