From 5d3debca82ecb4e290f20cd79f7774e1e5a2ebfa Mon Sep 17 00:00:00 2001 From: bodoque007 Date: Sat, 12 Jul 2025 04:58:30 -0300 Subject: [PATCH 1/2] Add conditional import for pickle5 in unit-2 hands-on --- notebooks/unit2/requirements-unit2.txt | 4 ++-- units/en/unit2/hands-on.mdx | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/notebooks/unit2/requirements-unit2.txt b/notebooks/unit2/requirements-unit2.txt index 3209a69c..da3bd56c 100644 --- a/notebooks/unit2/requirements-unit2.txt +++ b/notebooks/unit2/requirements-unit2.txt @@ -3,9 +3,9 @@ pygame numpy huggingface_hub -pickle5 +pickle5; python_version < "3.8" pyyaml==6.0 imageio imageio_ffmpeg pyglet==1.5.1 -tqdm \ No newline at end of file +tqdm diff --git a/units/en/unit2/hands-on.mdx b/units/en/unit2/hands-on.mdx index f55cc13e..ecfa3065 100644 --- a/units/en/unit2/hands-on.mdx +++ b/units/en/unit2/hands-on.mdx @@ -182,7 +182,10 @@ import imageio import os import tqdm -import pickle5 as pickle +try: + import pickle5 as pickle +except ImportError: + import pickle from tqdm.notebook import tqdm ``` From 794781a64d504cd999b3498569c04a86cb76b387 Mon Sep 17 00:00:00 2001 From: Sebastian Sarco <63447579+bodoque007@users.noreply.github.com> Date: Sun, 13 Jul 2025 04:38:25 -0300 Subject: [PATCH 2/2] Add conditional import to notebook --- notebooks/unit2/unit2.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/notebooks/unit2/unit2.ipynb b/notebooks/unit2/unit2.ipynb index e9ae624c..0cb3f196 100644 --- a/notebooks/unit2/unit2.ipynb +++ b/notebooks/unit2/unit2.ipynb @@ -289,7 +289,10 @@ "import os\n", "import tqdm\n", "\n", - "import pickle5 as pickle\n", + "try:\n", + " import pickle5 as pickle\n", + "except ImportError:\n", + " import pickle\n", "from tqdm.notebook import tqdm" ] }, @@ -1769,4 +1772,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +}