linyiLYi / snake-ai

An AI agent that beats the classic game "Snake".
Apache License 2.0
1.61k stars 359 forks source link

pip install gym error #13

Open vitojan opened 1 year ago

vitojan commented 1 year ago
(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>

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

limcod commented 1 year ago

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

limcod commented 1 year ago

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)

解决了问题

truebelief commented 1 year ago
(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

vitojan commented 1 year ago

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

JackDemo commented 1 year ago

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

timing2022 commented 1 year ago
(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 我就是这样解决的

DennisWang917 commented 8 months ago

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

yosg commented 5 months ago

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

gym 存在兼容性问题。