pip:“extras_require”必须是一个字典,其值是包含有效项目/版本要求说明符的字符串或字符串列表

use*_*967 2 python pip openai-gym

我尝试跑步pip install gym==0.21.0

\n

但出现了神秘的错误:

\n
Collecting gym==0.21.0\n  Using cached gym-0.21.0.tar.gz (1.5 MB)\n  Preparing metadata (setup.py) ... error\n  error: subprocess-exited-with-error\n  \n  \xc3\x97 python setup.py egg_info did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [1 lines of output]\n      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.\n      [end of output]\n  \n  note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: metadata-generation-failed\n\n\xc3\x97 Encountered error while generating package metadata.\n\xe2\x95\xb0\xe2\x94\x80> See above for output.\n\nnote: This is an issue with the package mentioned above, not pip.\nhint: See above for details.\n
Run Code Online (Sandbox Code Playgroud)\n

可能是什么原因导致此错误?

\n

des*_*ger 7

根据https://github.com/openai的问题部分中的评论,这些是需要进行的更改 -

  1. pip install setuptools==65.5.0 pip==21 # gym 0.21 installation is broken with more recent versions
  2. pip install wheel==0.38.0

我遇到了同样的问题,经过上述操作后,问题得到了解决。

该问题已在此处此处得到解决。