snake-ai
snake-ai copied to clipboard
pip install gym error
(SnakeAI) U:\桌面\snake-ai-master>pip install -r requirements.txt
Collecting gym==0.21.0
Downloading gym-0.21.0.tar.gz (1.5 MB)
---------------------------------------- 1.5/1.5 MB 3.3 MB/s eta 0:00:00
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.
(SnakeAI) U:\桌面\snake-ai-master>
各位先進請問一下安裝錯在哪了?
我也是安装错误 我这个是版本不对吗 但是我都是按照描述里操作 请问各位我应该怎么操作或者说是哪里没有注意到弄错了
我也是安装错误 我这个是版本不对吗 但是我都是按照描述里操作 请问各位我应该怎么操作或者说是哪里没有注意到弄错了
gym 的bug 我修改了 /usr/local/python3.7/lib/python3.7/site-packages/wheel/vendored/packaging/requirements.py
` def init(self, requirement_string: str) -> None:
try:
if requirement_string.find('opencv-python>=3.')>=0:
requirement_string += "0" # opencv-python>=3.0
parsed = parse_requirement(requirement_string)
解决了问题
(SnakeAI) U:\桌面\snake-ai-master>pip install -r requirements.txt Collecting gym==0.21.0 Downloading gym-0.21.0.tar.gz (1.5 MB) ---------------------------------------- 1.5/1.5 MB 3.3 MB/s eta 0:00:00 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. (SnakeAI) U:\桌面\snake-ai-master>
各位先進請問一下安裝錯在哪了?
可以先运行 pip install setuptools==63.2.0
感謝各位先進的幫助,另外我發現使用
conda install -c conda-forge gym
也能解決
pip install setuptools==65.5.0 "wheel<0.40.0" 更详细来自于 https://www.saoniuhuo.com/question/detail-2667936.html
(SnakeAI) U:\桌面\snake-ai-master>pip install -r requirements.txt Collecting gym==0.21.0 Downloading gym-0.21.0.tar.gz (1.5 MB) ---------------------------------------- 1.5/1.5 MB 3.3 MB/s eta 0:00:00 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. (SnakeAI) U:\桌面\snake-ai-master>
各位先進請問一下安裝錯在哪了?
pip install setuptools==63.2.0 可以参考这个文章https://www.cnblogs.com/huangshiyu13/p/17222706.html 我就是这样解决的
我把requirements里对版本的要求删掉然后安装就能运行了
参考这个回答:https://stackoverflow.com/questions/77124879/pip-extras-require-must-be-a-dictionary-whose-values-are-strings-or-lists-of
gym 存在兼容性问题。