Advice on remote interpreter (Windows to Windows)
Hello,
I could use some help with difficulties I'm experiencing. I hope I'm in the right place and some witty minds can nudge me in the right direction. I use PyCharm Professional 2017.2.3 on my notebook(Windows 10 Pro). I would like to be able to run/debug/deploy scripts to an remote machine currently with Windows 10 Pro, could be downgraded to Windows 7 if necessary. The scripts I'm creating are for automating UI stuff on Windows applications. I'm using packages like pywinauto and selenium.
I've tried two possible main solutions, but both did not provided me with satisfactory results.
WSL
On the remote machine I've installed WSL following the instructions provided by Jetbrains, and am able to setup a working remote interpreter by SSH.
The problem occurs on running my scripts. I guess because the Python instance used is running under Bash, I can't make use of pywinauto because it needs win32process. So unless there is a way to support win32process, or to redirect to a Windows instance of Python, this option can't be used.
Native Windows
Another option I tried is installing Python in Windows on the remote machine. I've also installed Win32 OpenSSH and the connections seems fine. When I add it as a remote interpreter it seems incorrect because it states "unknowns interpreter" and is not able to show a list of installed packages.
When I select the "Install packaging tools" it gives an error about not recognising "env".
I could really use some help here. Thank you in advance.
With kind regards,
请先登录再写评论。
Hi there,
Nice experiments!
I've got a similar case. I'd like to run my Python code on Windows 10 via remote interpreter. And my code uses CUDA.
Exp0 - WSL
WSL itself won't work for me – they do not provide access to the GPU. Here's another post, Is there anyway to make remote interpreter point to a windows version python.exe?, about an attempt to use WSL to access native Windows python. AFAIU, it doesn't work.
Exp1 - KpyM ssh server
The KpyM ssh server is yet another ssh server for windows (some other options: 1,2). Easy to install, works exactly like normal local cmd. I’m not sure if there’s any difference in PyCharm behavior for KpyM vs OpenSSH, but I’d like to add some details I’ve noticed:
However, there’s something broken in PyCharm 2017.3.2.
sometimes, there’s also an error message:
Exp2 - Cygwin ssh server + native windows python / in-cygwin python
Cygwin sounds less like “native windows”. It feels weird to use it to run a native Windows app. And it’s less easy to install (personally, I’ve mostly followed this).
However, there’s something broken in PyCharm again.
E.g. it is possible to run the script and copy files back-and-forth. The rest (debug, list of packages, ...) is broken.
(Debug works for the in-cygwin python)
Other experiments
There's a bunch of related issues on YouTrack. Most of them are linked PY-20952. Vote for it. Some of them contain interesting workarounds. E.g. PY-14404 and PY-22016 suggest to put windows-style path into "PyCharm helpers path" field. I've tried this trick (with my ".sh" wrapper and without it), and I can confirm that it fixes one thing (now the list of packages is displayed correctly) at the expense of two others (interpreter config is now highlighted with red "incomplete" mark and helpers auto-uploading/auto-update is unlikely to work).
Thus:
Hi,I hope this information can be useful. I am dealing with this issue too.
Here:
https://youtrack.jetbrains.com/issue/PY-20952
You can read the developer assigned for this issue, Alexander Koshevoy, saying to a user:
@Vladimir Avdoshka as for now we have no plans for implementing this in the next 2018.3 version unfortunately.
I voted for this issue to be addressed...