简体   繁体   中英

How do I launch Windows Anaconda python from WSL Ubuntu?

I have installed Anaconda for Windows 10. I later installed Ubuntu under the WSL. I would like to run the python from Anaconda in the Ubuntu shell. Is this possible? How do I activate the environment?

Alternatively, if I install Anaconda under ubuntu, will I be able to use that environment in Visual Studio 2019? (My end goal is to do my python dev in VS2019, be able to run in debug mode there, and also use the bash shell to run python scripts.)

You need to install anaconda on the linux partition.

Yes, you can use VS2019 on Ubuntu

download - install

You can use VS on Ubuntu's anaconda python, however you will need to install it there aswell, and for now there's no official support for wsl GUI from Microsoft, though you can still install thirth part programs that will do that for you.

In order to use Anaconda under the wsl shell you will first need to install it there.

You can do that by going into the anaconda webpage and copying the link to download the latest linux version, and under the bash you type wget [link] .

After the download is done you can install it running sudo bash [name of the archive]

You can find it's name by typing ls , and it should match the version that you just downloaded.

after that you should reload the bash source ~/.bashrc and you should now be able to use anaconda under the linux bash, though it's not possible yet to have it on the GUI.

There are multiple alternatives if you still want it displaying in your browser, you could either change the path to output in your windows browser, install a complete linux GUI or just use a windows software to display the anaconda GUI alone.

Assuming you want the later: Go to MobaXterm website and download it. This is a lightweight software that comes with various inbuilt tools to access SSH server, VNC, SFTP, Command Terminal, and more.

  • Open the MobaXterm, once you have that on your system.

  • Click on the Session option given in the Menu of its.

  • Select WSL available at the end of the tools menu.

  • From Basic WSL Setting, click on the Dropdown box and select Ubuntu and press the OK button.

  • Now you will see your Ubuntu WSL app on MobaXterm, great.

  • There, simply type: anaconda-navigator

  • That's it, this will open the graphical user interface of the Anaconda running on Ubuntu WSL app of Windows 10.

  • Start creating environments and Installation of different packages directly from the GUI of Navigator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM