栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

使用gym环境时报错:AttributeError: module ‘gym.envs.box2d’ has no attribute ‘BipedalWalker’

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用gym环境时报错:AttributeError: module ‘gym.envs.box2d’ has no attribute ‘BipedalWalker’

使用gym中"BipedalWalker-v3"环境的时候出现了如下报错:

AttributeError: module ‘gym.envs.box2d’ has no attribute
‘BipedalWalker’

解决办法:

1、下载swig包
在https://www.swig.org/download.html 下载swig包,解压保存在某路径,我安装在D:swigwin-4.0.2
也可以在此处下载

2、添加环境变量
pycharm中file -> settings -> Build, Execution, Deployment -> Console -> Python Console -> Environment variables 输入swig=D:swigwin-4.0.2swig.exe,确认



3、下载wheel:
在https://www.lfd.uci.edu/~gohlke/pythonlibs/#pybox2d下载适合的版本的Box2D包
也可以在此处下载
找到存储的位置:C:UsersthinkpadDownloadsBox2D-2.3.10-cp39-cp39-win_amd64.whl

4、执行:

pip install C:UsersthinkpadDownloadsBox2D-2.3.10-cp39-cp39-win_amd64.whl

运行结果如下图所示:


然后程序可以正常运行(安装完后wheel文件就可以删除了)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/890172.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号