简体   繁体   中英

Why can't i run my file on Pycharm?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM