1

Ubuntu 21.10, have created a new conda env, named "curpy", which includes python 3.1.0, keras, talos, etc, installed ipykernel, and when I open a jupyter notebook I can change to this kernel. Then I start getting 'no module' errors.

When I run this code in a cell, using an older environment which works but does provide some packages, it appears to work fine.

import sys
sys.path
sys.executable

I get the correct result, points to an older version of python etc.

'/home/name/miniconda3/envs/p3.7_keras_talos_env/bin/python'

However when I switch the kernel to the new one and run the same code it gives me the wrong (system default) version of python:

'/home/name/miniconda3/bin/python'

What I am expecting is

'/home/name/miniconda3/envs/curpy/bin/python'

What can I do to get jupyter to import/use the environment correctly. Thx. J

Jim Maas
  • 1,481
  • 2
  • 16
  • 36
  • Can you add what steps you took to register the new env as a kernel? Most likely you did something wrong there. Try to write it down in reproducible steps and put them in the question. Either you will already see the issue doing that or at least we will have a reproducible set of commands to debug – FlyingTeller Mar 01 '22 at 09:05
  • @FlyingTeller Thx. I created the new conda env, installed all the packages, including ipykernel in the new curpy env. Then deactivated curpy, activated base env, started jupyter notebook which sees the choice of the new curpy env, but it just doesn't work correctly, doesn't 'see' correct version of python or the packages. – Jim Maas Mar 01 '22 at 09:24
  • I found another approach ... and this worked https://stackoverflow.com/questions/37433363/link-conda-environment-with-jupyter-notebook?rq=1 using a different package called nb_conda. – Jim Maas Mar 01 '22 at 09:55

0 Answers0