-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Which version of matplotlib was used? #23
Comments
Hey! Thanks for the heads up on this issue! In the past we recommended conda (for notebook, pandas, numpy, matplotlib, scipy) along with a pip install of autograd. But with the custom animation work in the notes being an open vector for failure, I think your issue points to the need for upgraded guidance on installation. I'll provide this tomorrow and get back to you. As to your issue - I think there could be one of two things going on. I received this warning with matplotlib 3.5.1 + (plain) jupyter notebook, but visualizations / widgets work. I just pushed a temp warnings quiet fix. I received this warning with matplotlib 3.5.1 + jupyterlab but visualizations / widgets did NOT work. Working on a patch there - it appears some widgets / viz tools have trouble with jupyterlab. What setup are you using (distro, jupyter notebook/lab, docker, etc.,)? |
I generally use conda as well. I got the error with Python 3.9.12 and matplotlib: 3.5.1. But as you said, it looks like a jupyter issue. Here's following selected core Jupyter packages that gave me the problem (and it was a plain jupyter notebook, not jupyterlab)
As I said, even though jupyterlab is installed, I was just using jupyter notebook. I then created a conda environment with Python 3.8 and just installed jupyter (as well as some other packages), not jupyter lab. Then I got the warnings, but the plots rendered, as they did with you.
I think the main reason for having a |
It's really strange. I'm getting different results depending upon the version of matplotlib. Anyways, I created a conda enviroment with the following:
This reproduced the problem of the plots not rendering (of course, you then need to install autograd with pip) Then I did did the following:
Now the plots render (but with the error messages). The matplotlib versions are different in the two. The one that fails is I'm on a Mac (still on Catalina, 10.15.7), but I didn't think that would make a difference. Anyways, maybe this would help diagnose the problem. |
After digging around a bit on the jupyter-side issue: I think the issue is with the conda installs of jupyter and/or matplotlib. Following your install instructions I encountered the same issue (mac Monterey 12.3.1). Looks like conda-forge matplotlib is 3.5.2 - but didn't seem to matter. What did work for me via conda env - using pip installs (all latest versions) instead of conda's. I've added instructions (below) for this conda approach and docker for running the notebooks - tested these on a) ubuntu 20.04 b) mac Monterey (12.3.1) and c) mac big sur 11.1. Both conda and docker methods worked for me - pull the repo for updates and let me know how things go on your end! Docker methodAfter installing docker and docker-compose on your machine
When running this command the first time an associated docker image is pulled from DockerHub. Then in any web browser go to
to view the repository contents - including jupyter notebooks. Anaconda methodAfter installing Anaconda Python 3 distribution on your machine, cd into this repo's directory and follow these steps to create a conda virtual environment to view its contents and notebooks. First, create the environment
Then activate it
Run jupyter via the command below
And finally, open any web browser and traverse to
to view the repository contents - including jupyter notebooks. |
Thanks for the detailed instructions! Unfortunately, that didn't work for me either. (I tried two methods -- I was a bit confused because I thought you had written that you installed the packages with pip, but wouldn't the method you have above install it with conda? -- It doesn't matter -- I tried There must be something on this machine. The version of matplotlib I installed from conda-forge is definitely I do have things working with the older version of matplotlib described with the method above. Thanks for the help. On Edit |
bummer! did the docker version not work? this should install a fresh containerized version of Python + required installs which should be distinct from your machine's Python. lol! you're right - the requirements.txt is conda installed the way I wrote the instructions. how about using
This works on my end (python 3.8). |
I'll have to try Docker tomorrow. As far as I can tell, if the matplotlib version is 3.5+, it doesn't work on this particular machine. (I did try pip3, but as it's the Anaconda version of Python that's in my path, I believe there's no difference between the two). As I said it's not very pressing, as it looks like I've got everything working with matplotlib 3.2.2. But again, thanks for all the assistance. |
gotcha! please re-open if you need any further help! |
Nice book and repo. I was running through some of the examples in the
2_5_Random.ipynb
. Some of the plots render OK, but then others don't (e.g.,static_plotter.two_input_surface_contour_plot
) and for those I get a long series of the following errors/warnings (matplotlib: 3.5.1).I was wondering whether you had a
requirements.txt
that specified the version of the libraries used for creating the notebooks.It might be something else than what the message says. I would have thought that warnings wouldn’t stop the plot from being run. But a
requirements.txt
might help identify the culprit.The text was updated successfully, but these errors were encountered: