I need help getting OpenAI Gym working with Atari games on my Windows 10 machine.
I managed to install the basic gym package through PyCharm’s project interpreter settings without any issues. However, when I attempt to create an Atari game environment like this:
import gym
game_env = gym.make('PongNoFrameskip-v4')
I encounter this error message:
ModuleNotFoundError: No module named 'atari_py'
...
SUGGESTION: Install Atari support with 'pip install gym[atari]'
Following the suggestion, I ran pip install gym[atari] in PyCharm’s terminal, but then I get:
Failed to run 'make build -C atari_py/ale_interface -j 11'. ERROR: Is `make` available on your system?
error: [WinError 2] Cannot locate the specified file
I downloaded and installed make from a GNU utilities website, but the problem persists. I also tried running pip install atari_py separately, which completes successfully but doesn’t fix the original issue.
I’m fairly new to Python development, so any guidance would be really helpful. Has anyone successfully set this up on Windows?
Had this exact problem about six months ago. Windows doesn’t have the build tools to compile atari-py from source. I fixed it by installing Microsoft Visual Studio Build Tools first - grab the standalone installer from Microsoft’s site. Make sure you select the Windows SDK during setup. After that, pip install gym[atari] worked perfectly. Took around 20 minutes total including the download. Also check your Python version - I had way better luck with Python 3.8 than the newer versions.
WSL worked perfectly when I hit the same compilation errors. Takes about 30 minutes to install WSL2 with Ubuntu, then you just use normal Linux commands. Set up my whole gym environment there and atari-py compiled without issues. You can keep using your Windows IDE - just point it at the WSL Python interpreter. Performance’s basically native and you skip all the Windows build tool nightmares. I’ve been running this setup for ML projects for over a year and won’t go back.
yeah man, windows can be tricky with this. i had issues too but using conda instead of pip was a game changer. just run conda install -c conda-forge gym-atari and it should sort out the dependencies for you without all that make hassle.
Try downloading the precompiled wheels with pip install --find-links https://github.com/Kojoley/atari-py/releases atari_py instead of building from source. Worked for me when compilation kept failing on Win10. Saves you from installing all the build tools.
This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.