1

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.

blackbird7
  • 13
  • 1
  • 4
  • 1
    Did a little red error-popup not appear on your screen (from the screenshotted image) when you selected /usr/bin as the location? 'location' there means the folder to create the project's virtualenv in, *not* the interpreter's location. I get an error, "Environment location directory is not empty", when trying to make a virtualenv in /usr/bin. Choose an empty folder to place your project environment in. – kcsquared Mar 17 '22 at 16:10
  • @kcsquared I didn't get the error pop-up, so I didn't know what went wrong for a long time. Glad to know what the actual problem was. Thank you! – blackbird7 Mar 18 '22 at 14:47

1 Answers1

3

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.

nanotek
  • 2,959
  • 15
  • 25
  • This works! Thank you so much! I previously thought I can only use the Existing environment once I make a New environment on Pycharm since a lot of Python Interpreter tutorials on YouTube started with the New environment. But glad to know it doesn't work that way. – blackbird7 Mar 18 '22 at 14:16
  • @blackbird7 Glad to help! (If an answer is helpful to you, please consider giving an upvote and 'accepting' an answer if it solves your problem) – nanotek Mar 18 '22 at 15:22