本文介绍: 下载完成以后是VS Installer,这次我们修改安装路径,不要放C盘了,我们在D盘新建文件夹叫Workspace,把其余路径原封不动搞进去。想跟随油管某视频复现强化学习方法玩超级马里奥的过程,结果在在Anaconda3虚拟环境中用pip安装nes_py时。刚刚安装忘记截图了,总之就是这个路径,vs文件夹下还有个package文件夹,一共两个路径。原来是我前段时间为了给C盘瘦身,把VS给全部清理了,因为目前主要精力在Python上。那这就好办了,去他给的官网下载就是了。最后点击安装就完成了!
项目场景:
想跟随油管某视频复现强化学习方法玩超级马里奥的过程,结果在在Anaconda3虚拟环境中用pip安装nes_py时一直报错,报错信息如下:
Building wheel for nes-py (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-cpython-37
creating buildlib.win-amd64-cpython-37nes_py
copying nes_pynes_env.py -> buildlib.win-amd64-cpython-37nes_py
copying nes_py_image_viewer.py -> buildlib.win-amd64-cpython-37nes_py
copying nes_py_rom.py -> buildlib.win-amd64-cpython-37nes_py
copying nes_py__init__.py -> buildlib.win-amd64-cpython-37nes_py
creating buildlib.win-amd64-cpython-37nes_pyapp
copying nes_pyappcli.py -> buildlib.win-amd64-cpython-37nes_pyapp
copying nes_pyappplay_human.py -> buildlib.win-amd64-cpython-37nes_pyapp
copying nes_pyappplay_random.py -> buildlib.win-amd64-cpython-37nes_pyapp
copying nes_pyapp__init__.py -> buildlib.win-amd64-cpython-37nes_pyapp
creating buildlib.win-amd64-cpython-37nes_pywrappers
copying nes_pywrappersjoypad_space.py -> buildlib.win-amd64-cpython-37nes_pywrappers
copying nes_pywrappers__init__.py -> buildlib.win-amd64-cpython-37nes_pywrappers
running build_ext
building 'nes_py.lib_nes_env' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for nes-py
Running setup.py clean for nes-py
Failed to build nes-py
Installing collected packages: nes-py, gym_super_mario_bros
Running setup.py install for nes-py ... error
error: subprocess-exited-with-error
× Running setup.py install for nes-py did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
running install
D:Anaconda3envsrlgamelibsite-packagessetuptoolscommandinstall.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating buildlib.win-amd64-cpython-37
creating buildlib.win-amd64-cpython-37nes_py
copying nes_pynes_env.py -> buildlib.win-amd64-cpython-37nes_py
copying nes_py_image_viewer.py -> buildlib.win-amd64-cpython-37nes_py
copying nes_py_rom.py -> buildlib.win-amd64-cpython-37nes_py
copying nes_py__init__.py -> buildlib.win-amd64-cpython-37nes_py
creating buildlib.win-amd64-cpython-37nes_pyapp
copying nes_pyappcli.py -> buildlib.win-amd64-cpython-37nes_pyapp
copying nes_pyappplay_human.py -> buildlib.win-amd64-cpython-37nes_pyapp
copying nes_pyappplay_random.py -> buildlib.win-amd64-cpython-37nes_pyapp
copying nes_pyapp__init__.py -> buildlib.win-amd64-cpython-37nes_pyapp
creating buildlib.win-amd64-cpython-37nes_pywrappers
copying nes_pywrappersjoypad_space.py -> buildlib.win-amd64-cpython-37nes_pywrappers
copying nes_pywrappers__init__.py -> buildlib.win-amd64-cpython-37nes_pywrappers
running build_ext
building 'nes_py.lib_nes_env' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> nes-py
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
问题描述
从上面的报错信息可以得知,我们的问题在于没有找到wheel,说明本地没有相关配置。而最后一行也告诉我们提示:不是pip的问题,而是上述提到的包(nes)的问题,所以看上面的报错信息找原因。
原因分析:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: https://visualstudio.microsoft.com/visual–cpp-build-tools/
原来是我前段时间为了给C盘瘦身,把VS给全部清理了,因为目前主要精力在Python上。
解决方案:
下载完成以后是VS Installer,这次我们修改安装路径,不要放C盘了,我们在D盘新建文件夹叫Workspace,把其余路径原封不动搞进去
刚刚安装忘记截图了,总之就是这个路径,vs文件夹下还有个package文件夹,一共两个路径。
最后点击安装就完成了!
解决结果:
安装依赖以后成功安装
原文地址:https://blog.csdn.net/m0_59180666/article/details/128769672
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_34304.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。