I'm learning Reinforcement learning and I'm having the following errors.
Error(1) = I can't set up the 'CarRacing-v0' gym environment without Box2D
Error(2) = I can't pip install the Box2D module.
Does someone know how to interpret these errors and help me fix this?
Edit:
When trying to pip install box2d-py I get this error:
Windows users need to do as follows:
pip install box2d
pip install box2d-py
Mac users should try:
brew install swig
pip install box2d-py
pip install box2d
terminates without errors under macOS Mojave (10.14)
根据gym
的setup.py
,它尝试导入的Box2D
似乎来自可选的依赖项box2d-py
,因此您需要运行pip install box2d-py
。
对于 Ubuntu 18.04,以下解决了我的健身房和月球着陆器问题:
pip3 install box2d-py
I know this does not solve the problem but after trying for an entire day I ended up running the game using Google Colab Notebooks . Only problem with that is it's a bit hard to render the screen but there is a post on the topic here .
For Ubuntu 20.04.3, I had to run the following:
sudo apt-get install swig build-essential python-dev python3-dev
before installing box2d-py
.
pip install Box2D
it will work 100%
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.