Skip to content
Advertisement

How to add Python Interpreter to PyCharm?

I followed a lot suggestions to add the interpreter to PyCharm, but they’re simply not working. I want to figure out what the exact problem is here.

First, it said no interpreter is found, so I tried using Python 3.10 in Anaconda. But it seems “pip install packages” don’t get used for Anaconda’s Python. So, I used Terminal to get a different Python PATH: open -e .bash_profile and to see which python versions I have using python -v, python3 -v, which python, which python3. So, I wanted to input /usr/local/bin/python3 or /usr/bin/python for the interpreter path.

The problem is that I can’t add them at all… “Add Python Interpreter” doesn’t let me click ‘ok’.

Need to Add Python Interpreter

I watched lots of YouTube tutorials and went through relevant websites for suggestions, but nothing works. I even got rid of Python from all the folders manually (except the ones that didn’t allow me to trash) and using Terminal as instructed (How to uninstall Python 2.7 on a Mac OS X 10.6.4?): sudo rm -rf Python, sudo rm -rf "/Applications/Python 2.7",

cd /usr/local/bin/
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm

Then, I tried reinstalling them using pip install python3. It says Python 3.9 already exists in some Frameworks location, and I am unsure where to go about from now since nothing seems to be working.

Any suggestions would be great. Thank you.

I’m new to programming and Stack Overflow (came here a couple of times for solutions but only recently signed up and posted), so if my questions should be posed another way, please let me know.

Advertisement

Answer

The interface shown in your image is for creating a new python environment (i.e. virtual environment). It sounds like you want to use an existing environment. So click on the Existing environment radia button in your image instead of New Environment. Then navigate to the python executable you want.

The prompts might make more sense to you if you click System Interpreter on the left hand side, but that shouldn’t be necessary.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement