不可能在raspberryPiOS上安装带有pyenv的wxPython

2024-09-26 22:12:11 发布

您现在位置:Python中文网/ 问答频道 /正文

更新(2020-12-16):创建日志

我可以重现错误,并在问题的末尾添加日志。不是整个日志。试图筛选关键字为错误为的段落

我想要达到的目标:

在运行RaspberryPiOS的Raspberry Pi上安装wxPython(内核版本:5.4,发布日期:2020年12月2日)

我遇到了什么问题:

我通过pyenv安装了一个python版本(3.8.6)。有了它,我试图通过pip安装wxPython。由于缺少必要的软件包,我收到了很多错误。我安装了一系列的软件包,这些软件包在一些博客文章和教程中都有名字。但即使在安装了它们之后,wxPython的安装也失败了。 然后我发现了一个非常有用的wiki条目here。除了构建python版本之外,我还遵循了这些步骤,因为我已经有了一个python版本(正如我后来了解到的,这不是一个好版本)。 两个小时前,我决定按照维基中的每一个步骤进行操作,瞧,wxPython终于安装好了。感谢上帝(或任何你相信的东西)。我必须提到,由于wiki,我使用了python3.8.2和wxpython4.0.7。我使用了–-enable-optimizations标志。但不要认为这面旗帜是成功的原因。我猜,pyenv在安装python版本时做了一些不同的事情

我的问题:

为什么不能用pyenv的python版本安装wxPython(已经安装了wxPython的所有依赖项)? 与让pyenv构建python相比,您自己构建python的主要区别是什么(应该在另一个主题/问题中提问?)

很抱歉,我不能在这里发布错误。昨天我真的很沮丧,没有保存日志就关闭了一切

更新:如顶部所述,我可以重现错误。第一个是通过pyenv和--enable-shared标志安装的Python 3.8.5

2020-12-16T12:49:56,257     make[1]: Verzeichnis „/tmp/pip-install-7qr9wfe6/wxpython/build/wxbld/gtk3/utils/wxrc“ wird betreten
2020-12-16T12:49:56,258     /tmp/pip-install-7qr9wfe6/wxpython/build/wxbld/gtk3/bk-deps g++ -c -o wxrc_wxrc.o -I/tmp/pip-install-7qr9wfe6/wxpython/build/wxbld/gtk3/lib/wx/include/gtk3-unicode-3.1 -I/tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/include -D_FILE_OFFSET_BITS=64 -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include  -D__WXGTK__      -I/tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/utils/wxrc -DWXUSINGDLL -DwxUSE_GUI=0 -pthread -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wno-deprecated-declarations -O2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/atk-1.0 -I/usr/include/pixman-1 -D_REENTRANT -I/usr/include/SDL2 -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/usr/include/webkitgtk-4.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4  -fvisibility=hidden -fvisibility-inlines-hidden   /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/utils/wxrc/wxrc.cpp
2020-12-16T12:49:58,651     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp: In member function ‘wxGLContextAttrs& wxGLContextAttrs::CoreProfile()’:
2020-12-16T12:49:58,652     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:48:19: error: ‘EGL_CONTEXT_OPENGL_PROFILE_MASK’ was not declared in this scope
2020-12-16T12:49:58,653          AddAttribBits(EGL_CONTEXT_OPENGL_PROFILE_MASK,
2020-12-16T12:49:58,654                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:49:58,913     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:48:19: note: suggested alternative: ‘GL_CONTEXT_PROFILE_MASK’
2020-12-16T12:49:58,914          AddAttribBits(EGL_CONTEXT_OPENGL_PROFILE_MASK,
2020-12-16T12:49:58,914                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:49:58,915                        GL_CONTEXT_PROFILE_MASK
2020-12-16T12:49:58,916     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:49:19: error: ‘EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT’ was not declared in this scope
2020-12-16T12:49:58,916                        EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT);
2020-12-16T12:49:58,917                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:49:59,248     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:49:19: note: suggested alternative: ‘GL_CONTEXT_CORE_PROFILE_BIT’
2020-12-16T12:49:59,249                        EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT);
2020-12-16T12:49:59,250                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:49:59,251                        GL_CONTEXT_CORE_PROFILE_BIT
2020-12-16T12:49:59,252     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp: In member function ‘wxGLContextAttrs& wxGLContextAttrs::MajorVersion(int)’:
2020-12-16T12:49:59,252     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:57:22: error: ‘EGL_CONTEXT_MAJOR_VERSION’ was not declared in this scope
2020-12-16T12:49:59,253              AddAttribute(EGL_CONTEXT_MAJOR_VERSION);
2020-12-16T12:49:59,253                           ^~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:49:59,511     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:57:22: note: suggested alternative: ‘EGL_CONTEXT_CLIENT_VERSION’
2020-12-16T12:49:59,512              AddAttribute(EGL_CONTEXT_MAJOR_VERSION);
2020-12-16T12:49:59,513                           ^~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:49:59,515                           EGL_CONTEXT_CLIENT_VERSION
2020-12-16T12:49:59,516     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp: In member function ‘wxGLContextAttrs& wxGLContextAttrs::MinorVersion(int)’:
2020-12-16T12:49:59,517     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:67:22: error: ‘EGL_CONTEXT_MINOR_VERSION’ was not declared in this scope
2020-12-16T12:49:59,518              AddAttribute(EGL_CONTEXT_MINOR_VERSION);
2020-12-16T12:49:59,519                           ^~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:49:59,742     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:67:22: note: suggested alternative: ‘EGL_CONTEXT_CLIENT_VERSION’
2020-12-16T12:49:59,743              AddAttribute(EGL_CONTEXT_MINOR_VERSION);
2020-12-16T12:49:59,745                           ^~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:49:59,746                           EGL_CONTEXT_CLIENT_VERSION
2020-12-16T12:49:59,747     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp: In member function ‘wxGLContextAttrs& wxGLContextAttrs::CompatibilityProfile()’:
2020-12-16T12:49:59,748     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:75:19: error: ‘EGL_CONTEXT_OPENGL_PROFILE_MASK’ was not declared in this scope
2020-12-16T12:49:59,749          AddAttribBits(EGL_CONTEXT_OPENGL_PROFILE_MASK,
2020-12-16T12:49:59,750                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:50:00,035     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:75:19: note: suggested alternative: ‘GL_CONTEXT_PROFILE_MASK’
2020-12-16T12:50:00,036          AddAttribBits(EGL_CONTEXT_OPENGL_PROFILE_MASK,
2020-12-16T12:50:00,037                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-12-16T12:50:00,038                        GL_CONTEXT_PROFILE_MASK
2020-12-16T12:50:00,039     /tmp/pip-install-7qr9wfe6/wxpython/ext/wxWidgets/src/unix/glegl.cpp:76:19: error: ‘EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT’ was not declared in this scope
2020-12-16T12:50:00,040                        EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT);
2020-12-16T12:50:00,040                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
...
2020-12-16T12:50:08,383     g++ -o wxrc wxrc_wxrc.o    -L/tmp/pip-install-7qr9wfe6/wxpython/build/wxbld/gtk3/lib    -pthread   -lwx_baseu_xml-3.1 -lexpat -lwx_baseu-3.1     -lwxregexu-3.1  -pthread   -Wl,--version-script,/tmp/pip-install-7qr9wfe6/wxpython/build/wxbld/gtk3/version-script -lz -ldl -llzma -lm  -lz -ldl -llzma -lm
2020-12-16T12:50:08,682     make[1]: Verzeichnis „/tmp/pip-install-7qr9wfe6/wxpython/build/wxbld/gtk3/utils/wxrc“ wird verlassen
2020-12-16T12:50:08,685     Error building
2020-12-16T12:50:08,686     ERROR: failed building wxWidgets
2020-12-16T12:50:08,696     Traceback (most recent call last):
2020-12-16T12:50:08,697       File "build.py", line 1510, in cmd_build_wx
2020-12-16T12:50:08,697         wxbuild.main(wxDir(), build_options)
2020-12-16T12:50:08,697       File "/tmp/pip-install-7qr9wfe6/wxpython/buildtools/build_wxwidgets.py", line 496, in main
2020-12-16T12:50:08,698         exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
2020-12-16T12:50:08,698       File "/tmp/pip-install-7qr9wfe6/wxpython/buildtools/build_wxwidgets.py", line 85, in exitIfError
2020-12-16T12:50:08,698         raise builder.BuildError(msg)
2020-12-16T12:50:08,699     buildtools.builder.BuildError: Error building
2020-12-16T12:50:08,700     Finished command: build_wx (26m12.365s)
2020-12-16T12:50:08,700     Finished command: build (26m12.365s)
2020-12-16T12:50:08,725     Command '"/home/pi/company/wx_test_2/venv/bin/python" -u build.py build' failed with exit code 1.
2020-12-16T12:50:08,796 ERROR: Command errored out with exit status 1: /home/pi/company/wx_test_2/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7qr9wfe6/wxpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7qr9wfe6/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ms1kcktj/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/company/wx_test_2/venv/include/site/python3.8/wxpython Check the logs for full command output.
2020-12-16T12:50:08,797 Exception information:
2020-12-16T12:50:08,797 Traceback (most recent call last):
2020-12-16T12:50:08,797   File "/home/pi/company/wx_test_2/venv/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 827, in install
2020-12-16T12:50:08,797     success = install_legacy(
...
...
...
2020-12-16T12:50:08,797   File "/home/pi/company/wx_test_2/venv/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py", line 241, in call_subprocess
2020-12-16T12:50:08,797     raise InstallationError(exc_msg)
2020-12-16T12:50:08,797 pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /home/pi/company/wx_test_2/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7qr9wfe6/wxpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7qr9wfe6/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ms1kcktj/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/company/wx_test_2/venv/include/site/python3.8/wxpython Check the logs for full command output.
2020-12-16T12:50:08,845 WARNING: You are using pip version 20.1.1; however, version 20.3.3 is available.
2020-12-16T12:50:08,845 You should consider upgrading via the '/home/pi/company/wx_test_2/venv/bin/python -m pip install --upgrade pip' command.
2020-12-16T12:50:08,846 Removed build tracker: '/tmp/pip-req-tracker-83o4yffe'

最好的 马可


Tags: installpipbuildsrcincludeusrcontextwxpython

热门问题