Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSL Conda Environment in PyCharm

I'm trying to set up a new dev environment on Windows 10. Let me set the stage with some key points:

I am using Ubuntu through Windows Subsystem for Linux (WSL). I have Anaconda3 installed on WSL. I have PyCharm installed on Windows 10.

I am attempting to use a Conda environment created in the WSL within PyCharm on Windows 10. For some reason I cannot find documentation or guidance on the process.

I have already successfully setup a virtualenv within WSL as a remote interpreter for PyCharm however it will not allow me to do the same with a Conda environment.

like image 768
hudsond7 Avatar asked Oct 16 '19 14:10

hudsond7


People also ask

Can we use conda environment in PyCharm?

PyCharm supports creating virtual environments for Python with Conda.

Can PyCharm work with WSL?

Professional feature: download PyCharm Professional to try. You can use Windows Subsystem for Linux (WSL) to work with a Python interpreter available in your Linux distribution.

How do I change environment in PyCharm?

Press Ctrl+Alt+S to open the IDE settings and select Project <project name> | Python Interpreter. icon and select Show All. Select the target environment from the list and click OK to confirm your choice.


1 Answers

This was possible by using the absolute path for the conda interpreter from within PyCharm.

e.g.

C:\Users\winuser\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\wslusr\anaconda3\envs\myenv\bin 

It is now (as of very recently) not.

like image 178
Michael Eaton Avatar answered Sep 21 '22 06:09

Michael Eaton