Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda on Windows subsystem for Linux (WSL) uses the "wrong" anaconda when creating a Jupyter Notebook

I am using Windows subsystem for Linux WSL with the Ubuntu App (Ubuntu 20.04 LTS). I have installed Anaconda (Anaconda3-2020.11-Linux-x86_64) on my Windows 10 Education 1909. I have Jupyter notebook, and can run this in the Firefox on my computer and it seams to be working properly. However when I try to install packages such as:

Ubuntu console: pip install scrapy

Then the Jupyter notebook can not find it.

Jupyter notebook: import scrapy

I am currently working in the base environment, but I believe that Jupyter is actually running python from a different source (I also have Anaconda on my Windows). I confirmed this by running: import sys and sys.version both in the WSL and in the Jupyter notebook.

Jupyter notebook returns: '3.6.6 |Anaconda, Inc.| (default, Oct 9 2018, 12:34:16) \n[GCC 7.3.0]'

WSL returns: '3.8.5 (default, Sep 4 2020, 07:30:14) \n[GCC 7.3.0]' confirming that the "wrong python is used".

I am hesitant to delete my Windows Anaconda since I have my precious environments all set up there and are using them constantly.

The spessific package that forces me to linux can be found at "http://www.nupack.org/downloads" but requires registration for downloads.

I do not have Anaconda or python in my Windows environment variables.

I would be happy If I either would know where to install my packages (as long as they are in Linux), or if someone knows how to force Jupyter to use the Anaconda from WSL.

like image 496
Øyvind Ødegård Avatar asked Nov 21 '25 06:11

Øyvind Ødegård


1 Answers

Thanks to Panagiotis Kanavos I found out that I had both Anaconda3 and Miniconda3 installed and that the WSL command line used the miniconda3 version while Jupiter Notebook used Anaconda3.

There is probably a way of specifying which version to use but for me I simply deleted Miniconda and it now works.

like image 173
Øyvind Ødegård Avatar answered Nov 22 '25 18:11

Øyvind Ødegård



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!