本文介绍: 下载完成以后是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/visualcpp-build-tools/

发现上述一行报错信息说明我们本地缺少msvc组件

原来是我前段时间为了给C盘瘦身,把VS给全部清理了,因为目前主要精力在Python上。

那这就好办了,去他给的官网下载就是了。


解决方案

下载官网文件

https://download.visualstudio.microsoft.com/download/pr/0502e0d3-64a5-4bb8-b049-6bcbea5ed247/d7293c5775ad824c05ee99d071d5262da3e7653d39f3ba8a28fb2917af7c041a/vs_BuildTools.exe

下载完成以后是VS Installer,这次我们修改安装路径,不要放C盘了,我们在D盘新建文件夹叫Workspace,把其余路径原封不动搞进去

刚刚安装忘记截图了,总之就是这个路径vs文件夹下还有个package文件夹,一共两个路径

最后点击安装就完成了! 

注意一定要勾选C++桌面开发 


解决结果:

安装依赖以后成功安装 

原文地址:https://blog.csdn.net/m0_59180666/article/details/128769672

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_34304.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注