huggingface / deep-rl-class

This repo contains the syllabus of the Hugging Face Deep Reinforcement Learning Course.
Apache License 2.0
3.78k stars 577 forks source link

Unit 6: Failed to install dependencies #251

Closed AnotherPianist closed 1 year ago

AnotherPianist commented 1 year ago

There's an error trying to install the dependencies for the Unit 6 notebook.

After running the !pip install -r https://raw.githubusercontent.com/huggingface/deep-rl-class/main/notebooks/unit6/requirements-unit6.txt code block, the output shows the following error:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting stable-baselines3[extra]
  Downloading stable_baselines3-1.7.0-py3-none-any.whl (171 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 171.8/171.8 KB 6.7 MB/s eta 0:00:00
Collecting huggingface_sb3
  Downloading huggingface_sb3-2.2.4-py3-none-any.whl (9.4 kB)
Collecting panda_gym==2.0.0
  Downloading panda_gym-2.0.0-py3-none-any.whl (26 kB)
Collecting pyglet==1.5.1
  Downloading pyglet-1.5.1-py2.py3-none-any.whl (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 23.1 MB/s eta 0:00:00
Requirement already satisfied: gym in /usr/local/lib/python3.9/dist-packages (from panda_gym==2.0.0->-r https://raw.githubusercontent.com/huggingface/deep-rl-class/main/notebooks/unit6/requirements-unit6.txt (line 3)) (0.25.2)
Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from panda_gym==2.0.0->-r https://raw.githubusercontent.com/huggingface/deep-rl-class/main/notebooks/unit6/requirements-unit6.txt (line 3)) (1.22.4)
Requirement already satisfied: scipy in /usr/local/lib/python3.9/dist-packages (from panda_gym==2.0.0->-r https://raw.githubusercontent.com/huggingface/deep-rl-class/main/notebooks/unit6/requirements-unit6.txt (line 3)) (1.10.1)
Collecting pybullet
  Downloading pybullet-3.2.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (91.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 91.7/91.7 MB 11.1 MB/s eta 0:00:00
Requirement already satisfied: torch>=1.11 in /usr/local/lib/python3.9/dist-packages (from stable-baselines3[extra]->-r https://raw.githubusercontent.com/huggingface/deep-rl-class/main/notebooks/unit6/requirements-unit6.txt (line 1)) (1.13.1+cu116)
Collecting gym
  Downloading gym-0.21.0.tar.gz (1.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 74.6 MB/s eta 0:00:00
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Since there was an error while installing the dependencies, the following code block that imports the modules throw the following error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-4-b636fb263e08>](https://localhost:8080/#) in <module>
----> 1 import pybullet_envs
      2 import panda_gym
      3 import gym
      4 
      5 import os

ModuleNotFoundError: No module named 'pybullet_envs'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
felipeoliverai commented 1 year ago

same error here.

AnotherPianist commented 1 year ago

same error here.

@felipeoliverai check https://github.com/huggingface/deep-rl-class/pull/252.

You just need to add a cell with

pip install setuptools==65.5.0

and run it before the cell that installs the dependencies:

!pip install -r https://raw.githubusercontent.com/huggingface/deep-rl-class/main/notebooks/unit6/requirements-u

With that, the notebook should run.

felipeoliverai commented 1 year ago

Thanks, @AnotherPianist, solved.