If you want to learn more about Machine Learning and AI there is great contest running on https://contest.openai.com/
The guide how to install all modules is great, but problems can still arise. After four days of trying i finally made it and it finally works!
System: Windows 10, 64 Bit.
So… what did i do wrong? Why did i took me so long?
– python 3.6.5 but 32- bit version
– installed gcc the wrong way
– tried to install gcc manually
– tried running throught pyCharm.
So let’s start with with Python Version:
You can find out what kind of version of python you have by looking at the Icon name. If you have 32 Bit Version it won’t work.
You need to install 64 bit Python. My version is : Python 3.6.5 – 2018-03-28
One of the requirments to run retro gym is gcc 5 or higher.
I did it throught cygwin.
Download 64 bit version from:
And follow this tutorial:
You need to copy
setup-x86_64.exe from downloads to your cygwin folder.
You run this command thorught cmd in your cygwin folder:
(Don’t forget, it is CMD not Cygwin!)
C:\cygwin64>setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-develwon't work. Also if you are currently in the project folder you can just write:
setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel
If you are getting the gcc package don’t forget to change
We wan’t the newer version after all. The same thing here:
../gcc-4.9.2/configure --program-suffix=-4.9.2 --enable-languages=c,c++ --disable-bootstrap --disable-shared
../gcc-7.3.0/configure --program-suffix=-7.3.0 --enable-languages=c,c++ --disable-bootstrap --disable-shared
At the end you should test the compiler. If it works we are ready to go!
Install from binary
Next you can install enviroment throught pip3:
pip3 install gym-retro
Running throught pyCharm
On the details page: https://contest.openai.com/details
There is this script:
import retro def main(): env = retro.make(game='Airstriker-Genesis', state='Level1') obs = env.reset() while True: obs, rew, done, info = env.step(env.action_space.sample()) env.render() if done: obs = env.reset() if __name__ == '__main__': main()
But if you run it thgouth IDE you get this:
C:\Users\programmer\PycharmProjects\untitled1\venv\Scripts\python.exe C:/Users/programmer/PycharmProjects/untitled1/retro-agent.py Traceback (most recent call last): File "C:/Users/programmer/PycharmProjects/untitled1/retro-agent.py", line 1, in <module> import retro ModuleNotFoundError: No module named 'retro' Process finished with exit code 1
The thing is you need to run this script throught terminal. Just run your script in terminal :
And you should get the ai playing the game Airstriker-Genesis on our screen.
Don’t forget to Add Python to your PATH!
GCC Needs to be 5 or Higher!
64 Bit versions of programs!
Run the retro-agent.py throught terminal!
Installing from source, possible problems: