Skip to content

Conversation

@mhucka
Copy link
Member

@mhucka mhucka commented Dec 26, 2025

Changes:

  • Update the !pip install command in all the tutorials in docs/tutorials/ to use pip install tensorflow==2.16.2 tensorflow-quantum==0.7.5.

  • Add a pip install of the Python package seaborn to the the MNIST tutorial. The tutorial imports seaborn, but does not install it. Seaborn seems to come preinstalled in Colab and the DevSite toolchain, but someone running the notebook outside of those environments may hit a "module not found" error. By running a !pip install seaborn after installing TF and TFQ, we can not only save users the annoyance; we can also save future TFQ maintainers the time to debug the problem if they encounter the missing module during local testing.

  • Pin the version of the Gym package installed in docs/tutorials/quantum_reinformcement_learning.ipynb. Previously, the tutorial simply did a !pip install gym without a version constraint. Versions higher than 0.24.1 are incompatible some code in that tutorial (at least in TFQ 0.7.5), leading to an error during execution in some environments. Version 0.24.1 is what is installed by scripts/ci_validate_tutorials.sh; that's how I found the right version to make things work.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mhucka mhucka marked this pull request as ready for review December 26, 2025 05:50
`docs/tutorial/mnist.ipynb` imports the `seaborn` package, but does not
install it. It seems to come preinstalled in Colab and the DevSite
toolchain, but someone running the notebook outside of those
environments may hit a "module not found error". By adding a `!pip
install seaborn` after installing TF and TFQ, we can not only save users
the annoyance; we can also save future TFQ maintainers the time to debug
the problem if they encounter the problem during local testing.
@mhucka mhucka changed the title Update tutorials to revise installation instructions for version 0.7.5 Update tutorials to revise the pip installation command for TFQ 0.7.5 and also avoid a couple of problems Dec 27, 2025
Versions of Gym after 0.24.1 have a compatibility problem with the code
in the `quantum_reinforcement_learning.ipynb` tutorial. Making sure to
get 0.24.1 solves that problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants