Getting PyCharm to recognize python on the windows linux subsystem (bash on windows) Getting PyCharm to recognize python on the windows linux subsystem (bash on windows) python python

Getting PyCharm to recognize python on the windows linux subsystem (bash on windows)


Using PyCharm Professional with WSL Python on Win10Starting SSH

PyCharm can only be configured to use WSL Python as a Remote Interpreter (this is due to lack of other public API).

  • Install Win10 build 14361 or later. You also can upgrade your current Insider Preview.
  • Install wsl (something like lxrun /install` && lxrun /update )
  • Run bash.exe
  • Update to latest version sudo apt-get update && sudo apt-get upgrade
  • Open /etc/ssh/sshd_config
    • Enable password authentication (unless you want to use public keys). Open /etc/ssh/sshd_config , and set PasswordAuthentication yes.
    • Since chroot is not implemented in WSL (yet), you also need to set UsePrivilegeSeparation no
    • Save and close it
  • Type sudo $(sudo which sshd) -d to run OpenSSH on foreground (it is much easier for debug). You should see something like Server listening on 0.0.0.0 port 22
  • From another bash.exe session try ssh 127.0.0.1
  • If you see message about ECDSA finger print, answer y . You should see password prompt. If you see it, then your server works correctly.

  • Turn it off with CTRL+C, and start server in daemon mode (sudo service ssh start). Looks like upstart is broken on current WSL, so you would need to run bash.exe, start sshd and keep console window opened since WSL stops when the last client disconnects. You may create wsl_ssh.bat file like bash.exe -c "sudo service ssh start &&& sleep 999d" and use it to launch ssh.

Configuring PyCharmPyCharm should be configured to use WSL as a remote interpreter but without deployment, since each drive on Windows is mapped to an appropriate folder in /mnt/<DRIVE_NAME> in WSL. So, you only need to configure the mapping. For remote interpreters, see configuration-remote-python-interpreters . You should use 127.0.0.1 as hostname, and login and password you entered after first lxrun /install. You also should set C:\ to /mnt/c/ in your mappings. See the video from the previous post.

Author: Ilya Kazakevich
14 Jun 2016, 17:20

https://youtrack.jetbrains.com/issue/PY-19129#comment=27-1469350


I tried working with most solutions but the main issue is that I can't downgrade OpenSSH on Windows to something below 7.5 as is recommended by JetBrains.

Luckily they have solved this issue for us! I have downloaded the Early Access version of Pycharm 2018.3

https://blog.jetbrains.com/pycharm/2018/10/pycharm-2018-3-eap-7/

enter image description here

This is however only available in the professional version.


I'd like to add the answer of bmjjr by stating that this is only available with the PyCharm Professional Edition. The Remote Interpreter feature is not available with the Community Edition, as I sadly found out:

Supported only in Professional Edition

  • Cython
  • Django
  • AppEngine
  • Flask
  • Jinja2
  • Mako
  • web2py
  • Pyramid
  • Profiler
  • SQLAlchemy
  • Diagrams
  • Remote interpreters, remote debugging, Vagrant, Docker
  • Duplicate code detection
  • Code coverage
  • .po files support
  • BDD support
  • Profiler integration
  • Thread Concurrency Visualization

https://www.jetbrains.com/pycharm/features/editions_comparison_matrix.html