fastbook
fastbook copied to clipboard
`pip install -Uqq fastbook` breaks conda environment
Each notebook (both original and clean) starts with a chunk that runs pip install -Uqq fastbook. This (silently) causes problems in some environments. For example, I created an environment with the following:
conda install -c fastai -c pytorch -c conda-forge fastai jupyter fastbook voila
After some solver effort, this creates a consistent conda environment, including nbconvert version 6.0.7. However, the pip install fastbook command in question downgrades nbconvert to version 5, breaking the running notebook.
Perhaps this specific behavior is actually a different bug (e.g., that the nbconvert dependency is specified incorrectly in either the conda or PyPI fastbook package; I can't readily locate the source for it. But even if this bug is fixed, it seems fragile to have behavior that causes "restart and run all" to unconditionally and silently change your environment.
I'm not sure I've fully analyzed what's going on, so I have no specific opinion on the solution, but it may be as simple as dropping the -U flag.
In Python for Data Analysis, 3E by Wes McKinney, the author mentions that using pip to update packages installed using conda, and vice-versa, can lead to problem in the environment.
Here is the link to the passage: https://wesmckinney.com/book/preliminaries.html#:~:text=While%20you%20can,conda%20install.
I would suggest either using conda to handle all package management, or using a pip environment to avoid problems.