1

I create a Conda environment (23OCT20A) and attach a Jupyter notebook to it. From the command line I install packages but Jupyter can't see them. It appears the Jupyter Notebook uses a different Python executable than the Conda command line environment.

How do I fix this?

From the command line the Conda environment looks to be using the correct Python: ('C:\Users\myUser\Miniconda3\envs\23OCT20A\python.exe')

From within Jupyter the Conda environment is different: ('C:\Users\myUser\Miniconda3\python.exe')

Here is how I check the Python version in each environment:

import sys
print (sys.executable)
  • 3
    Did you activate the virtual environment before launching the notebook? – 7koFnMiP Oct 23 '20 at 19:46
  • 2
    99.9% of the newbees don't realize that Anaconda requires activation instead of path hacks. – Peter Oct 23 '20 at 20:31
  • Do you mean does the environment have an * next to it when I enter 'conda env list'? – Matthew David Jankowski Oct 23 '20 at 21:38
  • Does this answer your question? [How to use Jupyter notebooks in a conda environment?](https://stackoverflow.com/questions/58068818/how-to-use-jupyter-notebooks-in-a-conda-environment) In particular, I highly recommend Option 3 using `nb_conda_kernels`, though I prefer a dedicated environment just for Jupyter, rather than putting it in **base**. – merv Oct 24 '20 at 16:35

0 Answers0