Problems with installation of PyMC4 on Windows

I followed the instructions on Installation of PyMC4, with

conda create -c conda-forge -n pymc_env "pymc>=4"
conda activate pymc_env

using Anaconda on Win11. However, I was NOT able to install PyMC4 AND JupyterLab/IPython. In contrast, installing PyMC3 worked smoothly.
Since my other efforts to install a current version PyMC without Anaconda have not been successful, I was wondering if this problem has also occurred to other users?

Welcome!

Am I correct in understanding that you can successfully install pymc v4 but that you cannot then install JupyterLab/IPython? What errors are you getting when you install JupyterLab/IPython?

Yes, that is correct. I get the following behavior:
“JupyterLab cannot be installed on this environment”

And when I create a new environment, I don’t have PyMC4 in the selection list.

You can have a base environment from which you launch jupyter and then select the conda environment as a kernel: How to add your Conda environment to your jupyter notebook in just 4 steps | by Noopur R K | Medium

Yup. Looks like you might be installing JupyterLab into a new environment. When you do that, conda will only install the packages necessary to get JupyterLab to work (which won’t include pymc). You just need to get pymc and JuypterLab installed in a single environment (the “base” environment would work).

It looks there is an incompatability between the requirements of PyMC4 and of Jupyter. (Note that I am on a Win11 machine, and on Anaconda 2.3.2, which might not correspond to your spec).

  • When I start an environment with Python 3.11, I have PyMC available for installation; but I cannot install the IPython kernel.
  • In contrast, when I choose a Python version < 3.11, I can install Python and Jupyter, but only have PyMC2 and PyMC3 available.

Can you please tell me what the requirements for PyMC4 are?
Or do you suggest that I uninstall Anaconda, and give it a try with MiniForge?

PS: I looked at the link that you suggested at Medium, but also following the instructions there, I ran into the same compatability problems mentioned above.

Requirements are here. I do not believe that PyMC is being testeed on python 3.11, though I’m not sure that’s related. Are you using the installation instructions or attempting to install some other way?

I followed the instructions there.

When I executed
conda create -c conda-forge -n pymc_env "pymc>=4"
as suggested, I got Python 3.11. Since Ipython and Jupyter are not installed by default, I followed up the installation (after activating the environment) with
conda install ipython
Here the first “Package conflict” was reported.

So I tried
conda create -c conda-forge -n pymc_env_2 "pymc>=4" “python<3.11”
After that, I could (after activating the corresponding environment) execute
conda install ipython
But
conda install jupyter
produced another package conflict.

The same happened when I tried
conda create -c conda-forge -n pymc_env_3 "pymc>=4" “python<3.10”

It would be extremely helpful if you could provide (in the docu) information over one combination that worked for you.

Could this be a conflict between the defaults channel of conda and the conda-forge channel?
It it is, then conda install -c conda-forge jupyter should work.

1 Like

Yes, that was the solution! Thank you very much for your support!

It might be worthwhile making a comment in
https://www.pymc.io/projects/docs/en/latest/installation.html
since a lot of information about PyMC is available as jupyter notebooks.

1 Like

I am looking into this.

I would also suggest (as I often do) the use of mamba (which I believe uses conda-forge by default) or check out micromamba. Each is a drop-in replacement for conda (but check the links to learn about the differences).

1 Like