m2 mini 和 intel macbook都成功run起来

Author: ifree321Created Dec 24, 2024Updated Jul 18, 2026

intel macbook 按步骤只遇到了一个问题,然后 修改requirements.txt

gym-retro==0.8.0
stable-baselines3==2.1.0
tensorboard==2.15.1

就ok了。

m2 mini 尝试过stable-retro、使用python3.7的方法都没行; 还是从新使用3.8的环境 然后只做了修改: requirements.txt:

gym>=0.22.0, <=0.25.2
gym-retro==0.8.0
stable-baselines3>=1.7.0
tensorboard==2.12.1

然后python test.py遇到问题:


Fighting Begins!

Traceback (most recent call last):
  File "test.py", line 79, in <module>
    obs, reward, done, info = env.step(action)
  File "/Users/lymin/go/src/ai/street-fighter-ai/main/street_fighter_custom_wrapper.py", line 71, in step
    self.env.render()
  File "/opt/anaconda3/envs/StreetFighterAI/lib/python3.8/site-packages/gym/core.py", line 58, in render
    return render_func(self, *args, **kwargs)
  File "/opt/anaconda3/envs/StreetFighterAI/lib/python3.8/site-packages/retro/retro_env.py", line 228, in render
    from gym.envs.classic_control.rendering import SimpleImageViewer
ModuleNotFoundError: No module named 'gym.envs.classic_control.rendering'

然后 pip install gym==0.21.0,遇到了问题:

bash
 pip install gym==0.21.0

Collecting gym==0.21.0
  Using cached gym-0.21.0.tar.gz (1.5 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      /opt/anaconda3/envs/StreetFighterAI/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
        warnings.warn(msg)
      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.

然后pip install setuptools==65.5.0 pip==21执行完再 pip install gym==0.21.0,有提示error 但是:Successfully installed gym-0.21.0。 然后python test.py可以正常启动

image

Source: linyiLYi/street-fighter-ai