running code on a remote Linux machine, from a windows one

Hi Everyone,
I have this PyCharm/Python question that's been keeping me up nights for quite some time,
and I'd be happy if someone could help :-) :

I have PyCharm installed both on my laptop (windows), and on my main coding rig (Fedora Linux).
My project is stored on the Linux desktop, where I usually work/code/debug most of the time.

I've been searching for a way to write code on my laptop, but have it run directly on my Linux machine, from PyCharm.
I want the code I write in windows to be executed directly against my Linux hardware.
Ideally, I would just open PyCharm, tell it to connect to a 'Remote Project' or something, and from now on everything I do will be saved/run on my Linux machine.

After reading a bit, I thought maybe the 'Remote Interpreter' feature was what I needed. Unfortunately, even though I have SSH to my Linux system, I get an error about SFTP being invalid for some reason. Maybe that's not it?

Does anyone have an idea how to make this come true? that'd be much appreciated.
Thank you for your help.
12 comments
Comment actions Permalink
Remote interpreters are exactly what's need for this to work (along with Settings | Deployment for configuring automatic synchronization of source code between your laptop and remote machine). What exactly did the error message say?
0
Comment actions Permalink
Hi Dmitry,

When I test the connection, the error message says:
"Test SFTP Connection - Connection to xxx.xxx.xxx.xxx failed. Connection failed".

In "Auth Type" I have "password" selected...should it be like that for SSH?

Thank you for your help.
0
Comment actions Permalink
SSH supports both password and private key authorization. You should select the method that you normally use when connecting to the remote machine.
0
Comment actions Permalink
I used the password option, but still get the same error message.
perhaps i'm doing something wrong? should the host address have a prefix or something?

I'm really at odds here. I can easily connect to the host using putty ssh, but PyCharm just keeps giving me the same error.
0
Comment actions Permalink
OK, now I'm pretty sure this is a bug in the windows version of PyCharm and in it's builtin SSH use.

Here's what I tried:

1. PyCharm on my laptop trying to connect to my Linux machine = SFTP error in PyCharm.

2. PyCharm on another Linux machine (same network as before) trying to connect to my Linux machine = success!

3. PyCharm on the Linux machine from clause 2 (now running windows), trying to connect to another Linux machine = SFTP error in PyCharm.

It seems like there's a problem with the latest PyCharm on windows only. I'm not sure if PyCharm has a built in SSH client or if it's trying to use the default one in the system, but no matter what I do (even with cygwin installed), it fails on windows.

I'm on windows 7, I have SSH working fine with Putty and such, but despite that PyCharm can't connect to my Linux machine.
0
Comment actions Permalink
Do you use pageant for keeping track of your private key on your Windows machine?
0
Comment actions Permalink
I do not. I'm not trying to connect with the OpenSSH option but with the password one.
Again, this works fine on Linux.
0
Comment actions Permalink
Could you please run a protocol analysis tool such as Wireshark and capture a trace of PyCharm trying to establish the SFTP connection from your Windows machine?
0
Comment actions Permalink
Hi Dmitry,

I've ran Wireshark on both sides.
Here are the results:


The windows machine is 10.12.232.51
The Linux machine is 10.12.232.59


Here's what Wireshark sees on the windows machine:
windows_pycharm.pcapng (4.3KB)

And the error message I get in windows PyCharm:
sftp_error.JPG

The Linux machine capture shows this (Wireshark capture):
linux_remote (13KB)

As you can tell from the captures, PyCharm actually doesn't send any traffic on the wire in windows.
I can tell not only by Wireshark, but also by the immediate error I get, like there's no processing involved.  
Again, the same process works fine with a Linux to Linux connection.   

Thanks again for your help. Much appreciated.
0
Comment actions Permalink
Hi Dmitry,
Any thoughts? Is there something wrong with my configuration or could this be a bug?
0
Comment actions Permalink
Another test I just did:

1. Installed virtual box
2. Installed Linux on 1'st VM, Win7+PyCharm on 2'nd
3. Checked ping+SSH works between both machines flawlessly
4. Opened Pycharm on Win7 VM, tried to configure remote interpreter to linux machine
5. Right away get the same SFTP error message - PyCharm isn't even trying to connect

Pretty much at odds here.
0
Comment actions Permalink
Fixed in PyCharm 2.6.2.
Thank you!
0

Please sign in to leave a comment.