Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install gym error #13

Open
vitojan opened this issue May 30, 2023 · 8 comments
Open

pip install gym error #13

vitojan opened this issue May 30, 2023 · 8 comments

Comments

@vitojan
Copy link

vitojan commented May 30, 2023

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

limcod commented May 31, 2023

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

@limcod
Copy link

limcod commented May 31, 2023

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
Copy link

(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
Copy link
Author

vitojan commented Jun 2, 2023

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

@JackDemo
Copy link

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

@timing2022
Copy link

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

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

@yosg
Copy link

yosg commented May 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants