Reputation: 3
I get this error:
Error running 'filename.py': Cannot run program "/home/my_name/PycharmProjects/untitled/venv/bin/python" (in directory "/home/my_name/repo_name/ocr"): error=2, No such file or directory
/home/my_name/PycharmProjects/untitled/file.py
is the first file I created after installing PyCharm to make sure it's working then deleted it.
I want to run filename.py which is in ocr
but I'm getting the above error.
I tried in the cmd python filename.py
and worked just fine, so it's definitely related to PyCharm.
How to properly adjust my files once and for all, since I just installed it?
Upvotes: 0
Views: 5333
Reputation: 20609
Your error contains this:
Cannot run program "/home/my_name/PycharmProjects/untitled/venv/bin/python"
which indicates, that nothing is wrong with your file, but, instead pycharm cannot locate the python interpreter. It is configured to use a venv one in a project folder "untitled" which, as you said, you deleted. You should choose another interpreter
Upvotes: 3