huggingface / huggingface/deep-rl-class
[HANDS-ON BUG] Bonus Unit 1 (Huggy) - mlagents-learn command not found after Colab Python 3.14 update
- Dominant language
- MDX
- Stars
- 5k
- Forks
- 811
- PR merge metrics
- No merged PRs in 30d
Description
# Describe the bug
Google Colab now ships with Python 3.14 by default, which is incompatible with the ml-agents `python_requires` constraint. The notebook already creates a conda environment with Python 3.10.12 in `/usr/local`, but `!source /usr/local/bin/activate` and `!export` commands don't persist across Colab cells (each `!` runs in its own subshell). Because of this, the later `pip3 install -e ./ml-agents-envs` and `pip3 install -e ./ml-agents` cells silently install into the wrong (3.14) Python, and running training/upload later fails with:
/bin/bash: line 1: mlagents-learn: command not found
/bin/bash: line 1: mlagents-push-to-hf: command not found
# Material
- Did you use Google Colab? Yes
# Expected behavior
After creating the Python 3.10 conda environment and installing ml-agents, `mlagents-learn` and `mlagents-push-to-hf` should be available on the PATH so training and pushing to the Hub work as described in the notebook.
# Suggested fix
Instead of relying on `source activate` / `export` (which don't persist across cells), call the interpreter and installed console scripts by absolute path:
```python
%cd /content/ml-agents
!/usr/local/bin/python -m pip install -e ./ml-agents-envs
!/usr/local/bin/python -m pip install -e ./ml-agents
```
and later:
```python
!/usr/local/bin/mlagents-learn ./config/ppo/Huggy.yaml --env=./trained-envs-executables/linux/Huggy/Huggy --run-id="Huggy2" --no-graphics
!/usr/local/bin/mlagents-push-to-hf --run-id="HuggyTraining" --local-dir="./results/Huggy2" --repo-id="/ppo-huggy" --commit-message="Huggy"
```
This worked for me and should help other students hitting the same Colab Python version issue.
Contributor guide
No contributing guide indexed for this repository
Research direction
Find the Bonus Unit 1 Huggy Colab notebook and inspect the environment setup, installation, training, and Hub-upload cells. Run the notebook with Python 3.10 and verify that both console commands are installed and available through their absolute paths, and that training and upload proceed as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- documentation, machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100