PYMC error to work on Jupyter Notebook

Hello,

I downloaded new Pymc4 with instructions on GitHub account and created new environment for it. When I open new pymc on Python by using Terminal on my MacBook, it works fine. However, it does not work on Jupiter notebook. I was bale to use pymc3 on Jupyter, but not able to use pymc4. I even tried to uninstall mini forge and all pymc files, directories and environments, too. I reinstalled them. Pymc3 working (I reinstalled it again), but pymc4 is not working. I am sending screenshot related to this problem. I hope anyone can help me related to this problem. Although I downloaded pymc4, as you can see I cannot see pymc package within pymc-dev-py39 environment.

Thanks in advance!

Screen Shot 2022-02-20 at 10.18.23 PM


1 Like

It doesn’t look like you have pymc installed at all in that last screenshot. But I’m not sure which screenshots are showing which environments (v3 vs. v4). Things are moving pretty quickly now that the v4 betas have been released, but you might try installing the beta via pip or conda. You will have to specifically request the v4 beta (or it defaults to the latest v3 release), but that’s how I have been installing (and I have jupyter working in my v4 environment). You may also have to ensure a specific version of scipy as well (see here).

1 Like

@muharrembb have you added your new V4 environment to Jupyter notebook? There are two ways you can enable Jupyter Notebooks in your Conda environments:

  1. Install jupyter notebook in every environment using conda install -c conda-forge notebook

  2. Install jupyter notebook in your base environment and add any new environments to the jupyter notebook by running this command in your Base command prompt:
    python -m ipykernel install --user --name=your_pymcv4_env

1 Like

Thanks for the reply. I added Jupyter notebook to both of my environments one for my pymc3, the other for the new pymc4 environment. I generally used pymc3. But it still gives an error. I tried many times, but pymc v4 is not showed up as installed. I reinstalled notebook as you recommended for both environments. Again pymc v4 is not working on jupyter.

@muharrembb Can you post the result of conda list command in both V3 and V4 environments of pymc?
I also have V4 installed as @cluhmann and I’m able to launch and use Jupyter notebooks.

@sree_datta @cluhmann Thanks for both of your helpful comments! I found a solution!

Although I downloaded properly pymc V4 on my computer, pymc as package was not showed. In my new environment (pymc-dev-py39) I have to install V4 my new environment by using:

pip install pymc --pre

After doing that on jupyter V4 started to worked! When I checked packages it showed pymc 4.0.0b2 in my conda list!

Thank you so much for your helps!

2 Likes

I get the same problem by the way, installed pymc yesterday on anaconda, and if I run python in the anaconda command line I can import pymc no problem, even though it takes a long time. But if I then launch jupyter from the same environment, import pymc gives ModuleNotFoundError.
a bit weird?

turns out it’s not a problem in pymc, obviously. The problem is that I assumed Jupyter was installed in the freshly installed pymc environment, but it’s not. So when you run jupyter notebook from pymc environment, I don’t know what happens, but anaconda launches jupyter notebook in another environment. still weird, but the solution is to just install jupyter notebook in the pymc environment

1 Like

After using the second method, it still appears ModuleNotFoundError.May I ask why this is? :smiling_face_with_tear: