In this section I will give the solutions I found for some problems with installation of certain packages. I am using Ubuntu 18.04 LTS (Bionic Beaver) as my OS.
It's better if you do a full installation of gym. More instructions for that here.
In this step you might get some errors with installation because of some missing packages.
sudo apt-get install -y python-numpy cmake zlib1g-dev libjpeg-dev libboost-all-dev gcc libsdl2-dev wget unzip swig
use this command to install all packages. This should resolve all problems.
I personally use Virtualenv because it's simple and effective to use.
Install it via
pip install virtualenv
I use Pyhton3 for all my projects. So creating an environment with python3 as default.
virtualenv -p python3 <envname>
It will create an environment. Now activate the environment with
source <envname>/bin/activate
and for deactivation
deactivate
In this environment you can perform all of your installations with pip.
I dont know why but this is a problem I face with Box2d. Nothing to worry solution is pretty easy.
You first need to uninstall Box2d.
pip uninstall box2d-py
Now execute the following commands.
git clone https://github.com/pybox2d/pybox2d
cd pybox2d/
python setup.py clean
python setup.py build
python setup.py install
This should resolve the problem.