0

I have created a new conda environment as such:

conda create -c conda-forge -n pymc3_env pymc3 theano-pymc mkl mkl-service

afterwards, I added it to my jupyter kernel as such:

python -m ipykernel install --user --name=pymc3_env

And then when I run this command in jupyter notebook:

import pymc3 as pm

I receive the following error:


ModuleNotFoundError Traceback (most recent call last) Input In [2], in <cell line: 1>() ----> 1 import pymc3 as pm

ModuleNotFoundError: No module named 'pymc3'

I would like to add that I made sure to select the pymc3_env as my jupyter kernel (see screenshot). Does anyone know how to resolve this issue?

enter image description here

Os GS
  • 69
  • 6

1 Answers1

0

Very likely you did not have the correct environment activated when registering the kernel. The kernel name is arbitrary, so just because it has the same name as the environment doesn't entail it corresponding to the environment.

Make sure the environment is activated and has ipykernel installed, then try rerunning the registration. You may need to remove the old registration first.

Better Setup (nb_conda_kernels)

I find the least error-prone setup is to have Jupyter installed in only one dedicated environment, together with the nb_conda_kernels package (e.g., like this). Then, any other environment with ipykernel installed will automatically be recognized by Jupyter as a potential kernel - no need to fuss around with manual registration.

merv
  • 67,214
  • 13
  • 180
  • 245