probml / pyprobml

Python code for "Probabilistic Machine learning" book by Kevin Murphy
MIT License
6.45k stars 1.52k forks source link

All notebooks fail when trying to instal probml-utils #1114

Open jdtardos opened 12 months ago

jdtardos commented 12 months ago

When executing this code:

try: from probml_utils import latexify, savefig, is_latexify_enabled except ModuleNotFoundError: %pip install -qq git+https://github.com/probml/probml-utils.git from probml_utils import latexify, savefig, is_latexify_enabled

Error Obtained:

Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Preparing metadata (setup.py) ... done Preparing metadata (setup.py) ... done Building wheel for probml-utils (pyproject.toml) ... done error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Building wheel for numba (setup.py) ... error ERROR: Failed building wheel for numba error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Building wheel for llvmlite (setup.py) ... error ERROR: Failed building wheel for llvmlite ERROR: Could not build wheels for numba, llvmlite, which is required to install pyproject.toml-based projects

ModuleNotFoundError Traceback (most recent call last) in <cell line: 6>() 6 try: ----> 7 from probml_utils import latexify, savefig, is_latexify_enabled 8 except ModuleNotFoundError:

ModuleNotFoundError: No module named 'probml_utils'

During handling of the above exception, another exception occurred:

ModuleNotFoundError Traceback (most recent call last) in <cell line: 6>() 8 except ModuleNotFoundError: 9 get_ipython().run_line_magic('pip', 'install -qq git+https://github.com/probml/probml-utils.git') ---> 10 from probml_utils import latexify, savefig, is_latexify_enabled 11 12 from jax.scipy.stats import norm

ModuleNotFoundError: No module named 'probml_utils'

In a Local Machine

Same problem happens in a local machine with conda environments based on python 3.11 or 3.10. However, it works in a conda environment based ob python 3.8

patel-zeel commented 12 months ago

Thank you for flagging the issue, @jdtardos. I tried to fix this by fixing some package versions in probml-utils library, can you please try again and see if the notebooks work as expected?

jdtardos commented 12 months ago

Thanks a lot, @patel-zeel. Now it's working OK on colab, with the following minor error msg:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. plotnine 0.12.3 requires numpy>=1.23.0, but you have numpy 1.22.4 which is incompatible.

But despite the message, it works nicely.

Still not working in a local machine with a fresh Anaconda3 installation (Python 3.11.4)

jdtardos commented 11 months ago

The instalation of probml-utils does not work in a new conda environment with python=3.11. Steps to reproduce:

conda create --name probml python=3.11 conda activate probml conda install scikit-learn matplotlib pandas seaborn pip install git+https://github.com/probml/probml-utils.git

On Mac with M1, after a few minutes, It fails with multiple errors while compiling sklearn cython files.

Workaround: do the same with python=3.10 and it works nicely.