我正在遵循一个教程,该教程要求我安装ppaquette-gym-doom。但是我不断收到错误消息,
ERROR: Failed building wheel for doom-py
我在MacBook上,并且正在python 3.6中使用anaconda环境。
我试图安装错误代码说我需要的软件包,
简单安装boost boost-python sdl2
点安装cmake
但是,这无助于修复错误。我也尝试在python 2.7上执行此操作,但它也无法正常工作。
这是完整的错误,
ERROR: Failed building wheel for doom-py
...
ERROR: Command errored out with exit status 1:
command: /Users/user/anaconda3/envs/DoomAi/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-install-hwwmtp15/doom-py/setup.py'"'"'; __file__='"'"'/private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-install-hwwmtp15/doom-py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-record-kij0gfeh/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-install-hwwmtp15/doom-py/
Complete output (137 lines):
running install
running build
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- Boost version: 1.70.0
-- Found the following Boost libraries:
-- filesystem
-- thread
-- system
-- date_time
-- chrono
-- regex
-- iostreams
-- atomic
CMake Deprecation Warning at cmake_modules/CreateLaunchers.cmake:48 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
src/vizdoom/CMakeLists.txt:13 (include)
-- Could NOT find GME (missing: GME_LIBRARIES GME_INCLUDE_DIR)
-- Using system zlib
-- Using system jpeg library
-- Using system bzip2 library
-- Using internal gme library
-- /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
-- /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
-- /private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-install-hwwmtp15/doom-py/doom_py/src/vizdoom/lzma/C
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could not find FMOD include files
-- Could NOT find MPG123 (missing: MPG123_LIBRARIES MPG123_INCLUDE_DIR)
-- Could NOT find FluidSynth (missing: FLUIDSYNTH_LIBRARIES FLUIDSYNTH_INCLUDE_DIR)
-- Boost version: 1.70.0
-- Found the following Boost libraries:
-- thread
-- system
-- date_time
-- chrono
-- atomic
-- Fluid synth libs: FLUIDSYNTH_LIBRARIES-NOTFOUND
-- Using python library: /Users/user/anaconda3/envs/DoomAi/lib/libpython3.6m.dylib
-- Using python include: /Users/user/anaconda3/envs/DoomAi/include/python3.6m
CMake Warning at /Users/user/anaconda3/envs/DoomAi/lib/python3.6/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.14/Modules/FindBoost.cmake:1822 (message):
No header defined for python-py368; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:124 (find_package)
-- Could NOT find Boost
CMake Warning at /Users/user/anaconda3/envs/DoomAi/lib/python3.6/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.14/Modules/FindBoost.cmake:1822 (message):
No header defined for python-py36; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:133 (find_package)
-- Could NOT find Boost
-- Boost library python-py36:
-- Could NOT find Boost
-- Boost library python36:
CMake Warning at /Users/user/anaconda3/envs/DoomAi/lib/python3.6/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.14/Modules/FindBoost.cmake:1822 (message):
No header defined for python-py3; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:133 (find_package)
-- Could NOT find Boost
-- Boost library python-py3:
-- Could NOT find Boost
-- Boost library python3:
CMake Error at /Users/user/anaconda3/envs/DoomAi/lib/python3.6/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.14/Modules/FindBoost.cmake:2155 (message):
Unable to find the requested Boost libraries.
Boost version: 1.70.0
Boost include path: /usr/local/include
Could not find the following Boost libraries:
boost_python
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:151 (find_package)
-- Found components for NumPy
-- NUMPY_ROOT_DIR = /usr/local
-- NUMPY_INCLUDES = /Users/user/anaconda3/envs/DoomAi/lib/python3.6/site-packages/numpy/core/include
-- NUMPY_LIBRARIES = /Users/user/anaconda3/envs/DoomAi/lib/python3.6/site-packages/numpy/core/lib/libnpymath.a
-- NUMPY_API_VERSION = 1.16.4
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-install-hwwmtp15/doom-py/doom_py/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-install-hwwmtp15/doom-py/doom_py/CMakeFiles/CMakeError.log".
Could not build doom-py: Command '['cmake', '-DCMAKE_BUILD_TYPE=Release', '-DBUILD_PYTHON=ON', '-DBUILD_JAVA=OFF', '-DPYTHON_EXECUTABLE:FILEPATH=/Users/user/anaconda3/envs/DoomAi/bin/python', '-DOSX_COCOA_BACKEND=OFF']' returned non-zero exit status 1.. (HINT: are you sure cmake is installed? You might also be missing a library. doom_py requires boost, boost-python, sdl2 on OSX (installable via 'brew install boost boost-python sdl2')
...
ERROR: Command errored out with exit status 1: /Users/user/anaconda3/envs/DoomAi/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-install-hwwmtp15/doom-py/setup.py'"'"'; __file__='"'"'/private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-install-hwwmtp15/doom-py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/8v/645qcxqj4lzbth2zf4x8dfcm0000gn/T/pip-record-kij0gfeh/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
答案 0 :(得分:0)
您可能会有更多运气为Homebrew Python构建此功能(在virtualenv中可以稍后将其清除)。
由于不再维护此软件包,因此代码可能已过时和/或无法使用。满足所有依赖性后,我最终遇到了编译错误,提示doom-py
与Anaconda中可用的最新版本boost
不兼容。
为Anaconda建造东西时,您需要记住两件事:
conda
与pip
混合总是很危险,因为它们无法管理彼此的软件包,因此,当您遇到冲突的集合时,您势必最终破坏设置文件(尽管您可以从头开始重新创建)。此外,Anaconda将修补程序应用于Python和其他一些软件包,因此同一软件包的conda和pip版本并不总是兼容。
conda
软件包应优先于pip
软件包-从某种意义上讲,它们不太可能以不可预测的方式破坏事物。根据https://github.com/ppaquette/gym-doom#dependencies,您需要以下依赖项:
python-numpy cmake zlib1g-dev libjpeg-dev libboost-all-dev gcc libsdl2-dev wget unzip git
由于您正在尝试在另一个环境中构建-该程序包不是为AFAICS设计的,因此所有赌注都关闭了-您需要查找那些依赖项-它们可能具有不同的名称,因此您您需要猜测-在Anaconda Cloud中并将它们安装到您的Anaconda环境中(如果在那里找不到任何内容,则必须从源代码进行构建)。
例如(链接具有安装命令):
请注意,上述某些软件包来自不同的非官方渠道,因此它们可能彼此不完全兼容。
在自制软件中,它们都存在于homebrew-core
中:
$ for l in cmake zlib libjpeg sdl2 boost; do brew search $l; done
==> Formulae
cmake
==> Casks
homebrew/cask/cmake
==> Formulae
lzlib zlib homebrew/portable-ruby/portable-zlib
==> Formulae
libjpeg libjpeg-turbo
==> Formulae
sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf
==> Formulae
boost boost-build boost-python boost-python@1.59 boost@1.57 boost@1.60
boost-bcp boost-mpi boost-python3 boost@1.55 boost@1.59
==> Casks
homebrew/cask/turbo-boost-switcher