Skip to content

Commit

Permalink
Extract PyTorch to a package extra dedicated to examples (#14)
Browse files Browse the repository at this point in the history
* Fix syntax to launch human play

* Move `torch` to a package extra dedicate to examples
  • Loading branch information
cloderic authored Oct 31, 2021
1 parent 05d008c commit f1387b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ pip install --upgrade pip
```

2. Install MinAtar:
To install the package and its dependencies
```bash
pip install .
```
If you have any issues with automatic dependency installation, you can instead install the necessary dependencies manually and run
```bash
pip install . --no-deps
```
To install additional dependencies that are used by some examples (in particular `PyTorch`) run
```bash
pip install ".[examples]"
```

To verify the installation is successful, run
```bash
Expand All @@ -49,7 +54,7 @@ The examples/random_play.py is a simple example to demonstrate how to use the mo
To play a game as a human, run examples/human_play.py as follows:

```bash
python human_play.py -g <game>
python examples/human_play.py -g <game>
```
Use the arrow keys to move and space bar to fire. Also, press q to quit and r to reset.

Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
'scipy>=1.2.1',
'seaborn>=0.9.0',
'six>=1.12.0',
]

examples_requires = [
'torch>=1.0.0',
]

Expand All @@ -30,4 +33,6 @@
license='GPL',
packages=packages,
entry_points=entry_points,
install_requires=install_requires)
install_requires=install_requires,
extras_require={'examples': examples_requires},
)

0 comments on commit f1387b4

Please sign in to comment.