【强化学习】安装gym==0.18.3报错的解决方法

安装gym==0.18.3报错的解决方法

Collecting gym==0.18.3
Using cached gym-0.18.3.tar.gz (1.6 MB)
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in gym setup command: ‘extras_require’ must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

在这里插入图片描述
参考了这位博主的帖子:【动手学强化学习】gym 0.18.3 安装教程

setuptools

setuptools是pip自带的包,默认是最新的版本,我原本setuptools的版本是68.2.2 ,直接安装gym0.18.3会报错,需要降版本,参考的版本57.5.0:

pip install --upgrade pip setuptools==57.5.0

wheels

原因同上,我原本wheel的版本是0.41.2,降为0.37.0

pip install --upgrade pip wheel==0.37.0

降完上面两个包的版本即可安装gym==0.18.3

pip install gym==0.18.3

在这里插入图片描述
这次没有报原来的错误,开始安装依赖

猜你喜欢

转载自blog.csdn.net/Ever_____/article/details/136801836