I just updated my Mac to "Big Sur" Version 11.6. Unfortunately, after doing this I can no longer run Python. I tried un-installing and re-installing Python and believe that I have done this successfully: running python3 -V
yields the message Python 3.8.2
. However, whenever I run a Python file in PyCharm, I now get an an error message like
Error running 'randomfile': Cannot run program "/Users/my_name/Desktop/my_folder/venv/bin/python" (in directory "/Users/my_name/Desktop/my_folder"): error=2, No such file or directory
To clarify, I can still run these Python files if I do this in the command line, e.g.
cd /Users/name_name/Desktop/my_folder
python3 randomfile.py
However, while I can run these files, I can't seem to do this any more in PyCharm.
Can anyone explain what I am doing wrong here? As I say, there was no problem before the Mac update.
Edit: I believe that the problem is somehow caused by the Python interpreter, or lack of. When I try to add a Python interpreter, I get the error message:
Invalid Python SDK
Does anyone know how I might go about fixing this?
Edit 2: In case it is helpful to anyone else: I just managed to fix this by deleting and re-creating my virtual environment.