I was given a code at school to modulate for a research project, but first I would like to run it as it is, unmodulated. Its written in Python, and I use Pycharm CE on Ubuntu 18.04 with Python 2.7 ... I've chosen the correct interpreter in the project settings (I think. The path is /usr/bin/python2.7) and I get this Error Message:
Error running 'project': Cannot run program "C:/WinPython-64bit-2.7.9.1/python-2.7.9.amd64/python.exe" (in directory "/home/user/Documents/model"): error=2, No such file or directory
Why is Pycharm still looking for the Interpreter in the folder that, I'm assuming, the user before me used to put it?
The Python "FileNotFoundError: [Errno 2] No such file or directory" occurs when we try to open a file that doesn't exist in the specified location. To solve the error, move the file to the directory where the Python script is located if using a local path, or use an absolute path.
That error is most likely related to your program, not the IDE. Chances are you need to specify where to find the file, otherwise it defaults into the current directory. One easy fix is to copy the file to open into the same directory as your Python program, then run it.
In PyCharm, open the Settings dialog Ctrl+Alt+S , navigate to Project < project name> | Python Interpreter. nearby the Python Interpreter field and select Show All.... The interpreter you use in your project will be selected in the list of the available interpreters. and copy the path from the Interpreter path field.
Do one of the following: Click the Python Interpreter selector and choose Add New Interpreter. Press Ctrl+Alt+S to open the project Settings/Preferences and go to Project: <project name> | Python Interpreter. Click the Add Interpreter link next to the list of the available interpreters.
You can fix this error by modifying the .idea/workspace.xml
file. Search and remove any old interpreters and put the correct one.
Answer inspired by Ryan Elfman's post: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206597295-Why-can-t-I-run-a-script-in-PyCharm-when-I-can-debug-it-I-get-CreateProcess-error-123
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With