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/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 +} 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 ```