I am using a macbook pro 15 as local machine and I have a remote server running ubuntu 14.04
I want to use the remote intepreter to run all the computation but I want t
It can be caused by one of the following:
Be sure your interpreter is chosen as SSH which is to compile, not STFP which is for deployment.
I'm running PyCharm 2018.3
First, I didn't have the [Errno 2] No such file or directory
problem. Then I had the problem out of nowhere.
The issue arose when I did:
By doing the steps above, I had [Errno 2] No such file or directory
problem.
The reason is that the folder is not automatically synced to the remote server (a bug?), nor could I find a way to configure it to sync. Configuring Deployment
and Path Mappings
did work, but it's too much manual labor and prone to error.
All I had to do is to add a new remote interpreter, despite that identical configurations already exists previously. (To be safe, I did remove the old ssh interpreter and the old deployments, also removed .idea folder) Then everything worked as expected.
Sometimes you can have everything set up correctly (interpreter, deployment, Path mapping, etc) but PyCharm keeps trying to use your local path on the remote machine.
If this happens, try this 4 fixes:
File->Invalid Caches / Restart
...if the problem is still not fixed:
Preferences->Python Interpreter->Path Mappings
and check the path mappings of the interpreter. They should look more or less like this:...again, if the previous step didn't work:
Run->Edit Configurations...
and check if the path mappings are correct:ModuleNotFoundError
but the connection seems to work, go to Run->Edit Configurations...->Environment Variables
and add your project's root path to the PYTHONPATH
variable.To execute your code on remote machine you'll have to perform few steps
Python Version (ssh://login@host:port/path/to/interpreter)
. Package list should be populated with records./
is equivalent to /my/root/path
, /dir
to /my/root/path/dir
etc.