3

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.

JIST
  • 1,139
  • 2
  • 8
  • 30
  • 1
    WSL is Linux. This problem has little to do with Windows. There may be multiple Python installations on the same machine, in separate [virtual environments](https://docs.python.org/3/tutorial/venv.html). Typically, Anaconda will try to install and use its own virtual environment. If you install a package on a different environment, Anaconda won't see it – Panagiotis Kanavos Mar 04 '21 at 12:12
  • 1
    What you posted shows that the "default" environment uses a newer Python version than the Anaconda installation – Panagiotis Kanavos Mar 04 '21 at 12:14
  • Thank you for pointing me in the correct direction, and that the problem was in Linux. I now found an old miniconda3 installation that I did not know of. – Øyvind Ødegård Mar 04 '21 at 12:21
  • And now it works, I just deleted miniconda and I am up and running. please post as an answer if you want me to accept it. – Øyvind Ødegård Mar 04 '21 at 12:33

1 Answers1

0

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.