pip install gym后报以下错误:
ERROR: Command errored out with exit status 1:
command: ‘c:\users\lxy\anaconda3\envs\pt\python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\Lxy\AppData\Local\Temp\pip-install-b0w6com5\gym\setup.py’"’"’; file=’"’"‘C:\Users\Lxy\AppData\Local\Temp\pip-install-b0w6com5\gym\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base ‘C:\Users\Lxy\AppData\Local\Temp\pip-install-b0w6com5\gym\pip-egg-info’
cwd: C:\Users\Lxy\AppData\Local\Temp\pip-install-b0w6com5\gym
Complete output (5 lines):
Traceback (most recent call last):
File “”, line 1, in
File “c:\users\lxy\anaconda3\envs\pt\lib\site-packages\setuptools_init_.py”, line 11, in
from ._deprecation_warning import SetuptoolsDeprecationWarning
ModuleNotFoundError: No module named ‘setuptools._deprecation_warning’
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
运行以下命令:
python -m pip install --upgrade setuptools
升级setuptools
pip install gym -i https://pypi.tuna.tsinghua.edu.cn/simple
成功安装gym