首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用conda在WSL ubuntu中安装nes-py的问题

使用conda在WSL ubuntu中安装nes-py的问题
EN

Stack Overflow用户
提问于 2021-12-30 07:33:31
回答 1查看 146关注 0票数 0

我试图使用pip install nes-py在WSL中安装nes-py,但是我得到了以下错误(我正在粘贴整个终端消息)。

代码语言:javascript
复制
Collecting nes-py
  Using cached nes_py-8.1.8.tar.gz (76 kB)
Requirement already satisfied: gym>=0.17.2 in /home/aarav18/anaconda3/lib/python3.9/site-packages (from nes-py) (0.21.0)
Requirement already satisfied: numpy>=1.18.5 in /home/aarav18/anaconda3/lib/python3.9/site-packages (from nes-py) (1.20.3)
Requirement already satisfied: pyglet<=1.5.11,>=1.4.0 in /home/aarav18/anaconda3/lib/python3.9/site-packages (from nes-py) (1.5.11)
Requirement already satisfied: tqdm>=4.48.2 in /home/aarav18/anaconda3/lib/python3.9/site-packages (from nes-py) (4.62.3)
Requirement already satisfied: cloudpickle>=1.2.0 in /home/aarav18/anaconda3/lib/python3.9/site-packages (from gym>=0.17.2->nes-py) (2.0.0)
Building wheels for collected packages: nes-py
  Building wheel for nes-py (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/aarav18/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qez02o65/nes-py_a58dccafc96a4ee491ab6256d3849570/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qez02o65/nes-py_a58dccafc96a4ee491ab6256d3849570/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-84x8fqpu
       cwd: /tmp/pip-install-qez02o65/nes-py_a58dccafc96a4ee491ab6256d3849570/
  Complete output (27 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.9
  creating build/lib.linux-x86_64-3.9/nes_py
  copying nes_py/nes_env.py -> build/lib.linux-x86_64-3.9/nes_py
  copying nes_py/_image_viewer.py -> build/lib.linux-x86_64-3.9/nes_py
  copying nes_py/__init__.py -> build/lib.linux-x86_64-3.9/nes_py
  copying nes_py/_rom.py -> build/lib.linux-x86_64-3.9/nes_py
  creating build/lib.linux-x86_64-3.9/nes_py/app
  copying nes_py/app/play_random.py -> build/lib.linux-x86_64-3.9/nes_py/app
  copying nes_py/app/cli.py -> build/lib.linux-x86_64-3.9/nes_py/app
  copying nes_py/app/play_human.py -> build/lib.linux-x86_64-3.9/nes_py/app
  copying nes_py/app/__init__.py -> build/lib.linux-x86_64-3.9/nes_py/app
  creating build/lib.linux-x86_64-3.9/nes_py/wrappers
  copying nes_py/wrappers/joypad_space.py -> build/lib.linux-x86_64-3.9/nes_py/wrappers
  copying nes_py/wrappers/__init__.py -> build/lib.linux-x86_64-3.9/nes_py/wrappers
  running build_ext
  building 'nes_py.lib_nes_env' extension
  creating build/temp.linux-x86_64-3.9
  creating build/temp.linux-x86_64-3.9/nes_py
  creating build/temp.linux-x86_64-3.9/nes_py/nes
  creating build/temp.linux-x86_64-3.9/nes_py/nes/src
  creating build/temp.linux-x86_64-3.9/nes_py/nes/src/mappers
  g++ -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/aarav18/anaconda3/include -I/home/aarav18/anaconda3/include -fPIC -O2 -isystem /home/aarav18/anaconda3/include -fPIC -Ines_py/nes/include -I/home/aarav18/anaconda3/include/python3.9 -c nes_py/nes/src/cartridge.cpp -o build/temp.linux-x86_64-3.9/nes_py/nes/src/cartridge.o -std=c++1y -march=native -pipe -O3
  error: command 'g++' failed: No such file or directory
  ----------------------------------------
  ERROR: Failed building wheel for nes-py
  Running setup.py clean for nes-py
Failed to build nes-py
Installing collected packages: nes-py
    Running setup.py install for nes-py ... error
    ERROR: Command errored out with exit status 1:
     command: /home/aarav18/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qez02o65/nes-py_a58dccafc96a4ee491ab6256d3849570/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qez02o65/nes-py_a58dccafc96a4ee491ab6256d3849570/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-kqt46_5n/install-record.txt --single-version-externally-managed --compile --install-headers /home/aarav18/anaconda3/include/python3.9/nes-py
         cwd: /tmp/pip-install-qez02o65/nes-py_a58dccafc96a4ee491ab6256d3849570/
    Complete output (27 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.9
    creating build/lib.linux-x86_64-3.9/nes_py
    copying nes_py/nes_env.py -> build/lib.linux-x86_64-3.9/nes_py
    copying nes_py/_image_viewer.py -> build/lib.linux-x86_64-3.9/nes_py
    copying nes_py/__init__.py -> build/lib.linux-x86_64-3.9/nes_py
    copying nes_py/_rom.py -> build/lib.linux-x86_64-3.9/nes_py
    creating build/lib.linux-x86_64-3.9/nes_py/app
    copying nes_py/app/play_random.py -> build/lib.linux-x86_64-3.9/nes_py/app
    copying nes_py/app/cli.py -> build/lib.linux-x86_64-3.9/nes_py/app
    copying nes_py/app/play_human.py -> build/lib.linux-x86_64-3.9/nes_py/app
    copying nes_py/app/__init__.py -> build/lib.linux-x86_64-3.9/nes_py/app
    creating build/lib.linux-x86_64-3.9/nes_py/wrappers
    copying nes_py/wrappers/joypad_space.py -> build/lib.linux-x86_64-3.9/nes_py/wrappers
    copying nes_py/wrappers/__init__.py -> build/lib.linux-x86_64-3.9/nes_py/wrappers
    running build_ext
    building 'nes_py.lib_nes_env' extension
    creating build/temp.linux-x86_64-3.9
    creating build/temp.linux-x86_64-3.9/nes_py
    creating build/temp.linux-x86_64-3.9/nes_py/nes
    creating build/temp.linux-x86_64-3.9/nes_py/nes/src
    creating build/temp.linux-x86_64-3.9/nes_py/nes/src/mappers
    g++ -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/aarav18/anaconda3/include -I/home/aarav18/anaconda3/include -fPIC -O2 -isystem /home/aarav18/anaconda3/include -fPIC -Ines_py/nes/include -I/home/aarav18/anaconda3/include/python3.9 -c nes_py/nes/src/cartridge.cpp -o build/temp.linux-x86_64-3.9/nes_py/nes/src/cartridge.o -std=c++1y -march=native -pipe -O3
    error: command 'g++' failed: No such file or directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/aarav18/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qez02o65/nes-py_a58dccafc96a4ee491ab6256d3849570/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qez02o65/nes-py_a58dccafc96a4ee491ab6256d3849570/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-kqt46_5n/install-record.txt --single-version-externally-managed --compile --install-headers /home/aarav18/anaconda3/include/python3.9/nes-py Check the logs for full command output.

我尝试过许多修复方法,比如克隆nes-py回购文件,并通过在它的目录中运行python setup.py install来安装它,更改MANIFEST.in文件和其他一些修复程序,但是没有什么效果。如果有人能在任何方面帮忙,那就太棒了!

提前感谢!

我是刚开始使用Conda和WSL/Ubuntu,所以在这方面的任何帮助都是非常感谢的。我以前只使用与VS代码集成的cmd。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-01-02 02:07:42

找到了解决办法。花了一段时间,但很简单。我只需要通过在终端上运行g++来安装sudo apt install g++。在那之后,其他的安装工作就像一个魅力。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70528648

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档