ssh deployment and remote running: file not found


Hi there, I'm currently trying to setup PyCharm such that I can upload (from PyCharm) and run my code (inside PyCharm) on a remote server with bash (so like ssh://username@server:22).

The problem is that I can't run my code on the server in PyCharm, as I get the following error:

ssh://username@server:22/usr/bin/python -u /home/username/Programming/PythonCode/ bash: line 0: cd: /home/username/Programming/PythonCode: No such file or directory /usr/bin/python: can't open file '/home/username/Programming/PythonCode/': [Errno 2] No such file or directory

So it looks like there's an easy configuration error in PyCharm but I just can't figure it out.

Some information on the folder structure and the PyCharm settings:

When you login on the server, the initial path is /home/username/. My code is stored and uploaded from deployment to /home/username/Programming/PythonCode, and python is available at /usr/bin/python.

Deployment options: Root path: /home/username , Local Path (on my local pc): /home/mmoser/PycharmProjects/General , Deployment path on server: /Programming/PythonCode. The upload of the code to my PythonCode works fine with these settings.

Run configuration: Script: /home/username/Programming/PythonCode/ (remote path), Working directory: /home/username/Programming/PythonCode (remote path).

So from my part, it looks like PyCharm can't execute the cd to change to the PythonCode folder, but I have no idea why because it works if I login manually via terminal and just copy the cd command.

Maybe somebody has an idea, thanks a lot already! :)

Please sign in to leave a comment.