snake-ai icon indicating copy to clipboard operation
snake-ai copied to clipboard

pip install gym error

Open vitojan opened this issue 1 year ago • 8 comments

(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>

各位先進請問一下安裝錯在哪了?

vitojan avatar May 30 '23 11:05 vitojan

image 我也是安装错误 我这个是版本不对吗 但是我都是按照描述里操作 请问各位我应该怎么操作或者说是哪里没有注意到弄错了

limcod avatar May 31 '23 06:05 limcod

image 我也是安装错误 我这个是版本不对吗 但是我都是按照描述里操作 请问各位我应该怎么操作或者说是哪里没有注意到弄错了

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)

解决了问题

limcod avatar May 31 '23 07:05 limcod

(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

truebelief avatar May 31 '23 20:05 truebelief

感謝各位先進的幫助,另外我發現使用 conda install -c conda-forge gym 也能解決

vitojan avatar Jun 02 '23 06:06 vitojan

pip install setuptools==65.5.0 "wheel<0.40.0" 更详细来自于 https://www.saoniuhuo.com/question/detail-2667936.html

JackDemo avatar Jun 11 '23 06:06 JackDemo

(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 我就是这样解决的

timing2022 avatar Jun 13 '23 03:06 timing2022

我把requirements里对版本的要求删掉然后安装就能运行了

DennisWang917 avatar Jan 26 '24 13:01 DennisWang917

参考这个回答:https://stackoverflow.com/questions/77124879/pip-extras-require-must-be-a-dictionary-whose-values-are-strings-or-lists-of

gym 存在兼容性问题。

yosg avatar May 17 '24 11:05 yosg