Practice lab C3W3 not working locally - many dependencies issues

I am trying to get the lab to work locally and run into dependencies problems.

Please, can you provide guidance.


What I tried getting mad:

    My projects on vscode didn't work well (on a poetry environment)
    I noticed tensorflow requires python 3.9 and Gym is only installable using conda so i created a conda virtual environment with Python 3.9.18
    I read this post [](https://error-on-jup) so created a new venv Python 3.7.16
    I started reinstalling all and checked all installed versions on online Labs.
    import pandas as pd

To work on the reinforcement learning lab locally, you will need to have the following specific versions of Python and the mentioned libraries installed:

    Python Version: Python 3.7 or higher
    Library Versions:
        OpenAI Gym: Version 0.18.0
        NumPy: Version 1.21.2
        Matplotlib: Version 3.4.3
        TensorFlow: Version 2.6.0
        Keras: Version 2.6.0
    conda activate course_3_7
    (course_3_7) me@me:~$ conda install pandas==1.0.3
    conda install ipykernel
    pip install gym==0.24.0
    pip install Pillow==7.1.2
    conda install tensorflow==2.1.0 > issues
    DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`.
    Warning: Gym version v0.24.0 has a number of critical issues with `gym.make` such that the `reset` and `step` functions are called before returning the environment. It is recommend to downgrading to v0.23.1 or upgrading to v0.25.1
    pip install gym==0.23.1
    pip install imageio (Ok)
    pip install pyvirtualdisplay==3.0
    sudo apt-get install xvfb
    No module named 'tensorflow_core.estimator'

    conda install -c conda-forge matplotlib

… then I stopped try to make it work by myself and asked you for your help.

My machine:
Debian12 with this GPU: VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)
On my system root python is Python 3.11.2
Architecture : x86_64
Processor(s) : 16
Identifiant constructeur : AuthenticAMD
Nom de modèle : AMD Ryzen 7 5800H with Radeon Graphi

Start by installing Anaconda for Linux:

That should cover most of the dependencies, unless you are referring to support (.py) files.

Hello Nevermnd,
I have just installed anaconda-navigator right now.

Created an environment with python 3.7 but cannot install gym 0.24.0 using
gymnasium 0.28.1 requires python >=3.9

Anaconda installation required 9GB of memory, plus an additional 4GB for the virtual environment and didn’t resolve the problem of ‘gym’ obsolescence.

I had to open the hood and dirty my hands but eventually I got it working.


Gym is a problem, as it is no longer supported.

Search online for its status, there is a successor package.

Yes TMosh thank you :smile:

Special thanks to Dibya Chakravorty. With his help, I successfully navigated through the issue and safely landed my moon lander. Hooray!
Youtube link [](https:// Dibya Chakravorty)

Before I forget, another tricky issue:

# Set the random seed for TensorFlow
# tf.random.set_seed(utils.SEED)
# tf.random.set_random_seed(utils.SEED) deprecated at home
tf.compat.v1.random.set_random_seed(utils.SEED) # use this instead

If you are interested in getting the lab working at home, you can ask me for details.


1 Like

Great news!