yanpanlau / DDPG-Keras-Torcs

Using Keras and Deep Deterministic Policy Gradient to play TORCS
715 stars 266 forks source link

Failed building wheel for Box2D-kengz #48

Open kk2491 opened 6 years ago

kk2491 commented 6 years ago

Hi Guys,

I have started working on Torcs using DDPG-Keras. This question is quite long, please bear with me.

As mentioned in the README, I followed the below procedure.

git clone https://github.com/yanpanlau/DDPG-Keras-Torcs.git
cd DDPG-Keras-Torcs
cp *.* ~/gym_torcs
cd ~/gym_torcs
python ddpg.py 

While running python ddpg.py I got the below error:

kk@kk-Lenovo-ideapad-320-15ISK:~/gym_torcs$ python ddpg.py 
Traceback (most recent call last):
  File "ddpg.py", line 1, in <module>
    from gym_torcs import TorcsEnv
  File "/home/kk/gym_torcs/gym_torcs.py", line 1, in <module>
    import gym
ImportError: No module named gym

To fix this error, I started installing gym by running the below command

kk@kk-Lenovo-ideapad-320-15ISK:~/gym_torcs$ pip install gym[all]

But I ended up in the below errors while installing gym.

  Failed building wheel for Box2D-kengz

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nlkdIE/Box2D-kengz/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-6P0gPk-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-nlkdIE/Box2D-kengz/

I tried running python ddpg.py again, but still getting the same error as before.

kk@kk-Lenovo-ideapad-320-15ISK:~/gym_torcs$ python ddpg.py 
Traceback (most recent call last):
  File "ddpg.py", line 1, in <module>
    from gym_torcs import TorcsEnv
  File "/home/kk/gym_torcs/gym_torcs.py", line 1, in <module>
    import gym
ImportError: No module named gym

Please help me to fix this error.

Thank you, KK

kk2491 commented 6 years ago

Hi Guys,

Just to update, I have fixed the issue installing the following packages.

xvfb 
libav-tools 
xorg-dev 
libsdl2-dev 
swig 
cmake

I was able to fix the error in

pip install gym[all]

Tried running python DDPG.py again.

Got the below error:

kk@kk-Lenovo-ideapad-320-15ISK:~/gym_torcs$ python ddpg.py 
Traceback (most recent call last):
  File "ddpg.py", line 5, in <module>
    from keras.models import model_from_json, Model
ImportError: No module named keras.models

Fixed it by running:

kk@kk-Lenovo-ideapad-320-15ISK:~/gym_torcs$  sudo pip install keras==1.1.0

Now getting the below error:

kk@kk-Lenovo-ideapad-320-15ISK:~/gym_torcs$ python ddpg.py 
Using TensorFlow backend.
Traceback (most recent call last):
  File "ddpg.py", line 5, in <module>
    from keras.models import model_from_json, Model
  File "/usr/local/lib/python2.7/dist-packages/keras/__init__.py", line 2, in <module>
    from . import backend
  File "/usr/local/lib/python2.7/dist-packages/keras/backend/__init__.py", line 64, in <module>
    from .tensorflow_backend import *
  File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 1, in <module>
    import tensorflow as tf
ImportError: No module named tensorflow

I am stuck here. Please help me to fix this error.

Thank you, KK

Thank you, KK

mukakasotechnologies commented 4 years ago

How do you install the packages you used to solve the errors on pip install gym[all], are the any special procedures because i noticed it while installing swig, the procedure involves using environmental variables.