我試圖在 WSL 中使用 安裝 nes-py pip install nes-py,但出現以下錯誤(我正在粘貼整個終端訊息)。
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 檔案以及其他一些修復,但沒有任何效果。如果有人能以任何方式提供幫助,那就太棒了!
提前致謝!
PS 我是使用 Conda 和 WSL/Ubuntu 的新手,因此也感謝這方面的任何幫助。我曾經只使用與 VS Code 集成的 cmd。
uj5u.com熱心網友回復:
找到了解決辦法。花了一段時間,但這是一個簡單的。我只需要通過sudo apt install g 在終端中運行來安裝 g 。在那之后,nes-py 安裝就像一個魅力。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/401858.html
下一篇:未處理的例外:MissingPluginException(在通道flutter_barcode_scanner上找不到方法scanBarcode的實作)
