Update (2020-12-16): Created a log
I could reproduce the error and appended a log to the end of the question. Not the whole log. Tried to filter for passages with keyword error.
What I want to achieve:
Installing wxPython on a Raspberry Pi running RaspberryPiOS (Kernel version: 5.4, Release date: December 2nd, 2020).
What problem I ran into:
I installed a python version (3.8.6) via pyenv. With that, I tried to install wxPython via pip. I got a lot of errors due to missing but necessary packages. I installed a bunch of packages which are named in several blog posts and tutorials. But even after installing them the installation of wxPython failed.
Then I found a very helpful wiki entry here. I followed the steps except building a python version since I already had one (not a good one as I learned later).
Two hours ago I decided to follow every single step in the wiki and voila, wxPython is finally installed. Thank god (or whatever you believe in). I've to mention, that due to the wiki I used Python 3.8.2 and wxPython 4.0.7. And I used the –-enable-optimizations
flag. But don't think that this flag is responsible for the success. Guess, that pyenv does something different when installing a python version.
My question(s):
Why isn't it possible to install wxPython with a python version from pyenv (with all the dependencies for wxpython already installed)? What is the main difference between building python on your own compared to let pyenv build it (should be asked in another topic/question?)?
I'm sorry that I can't post the error here. I was really frustrated yesterday and shut everything down without saving the logs.
Update: as mentioned at the top, I could reproduce the error. First one is with Python 3.8.5 installed via pyenv and the --enable-shared
flag.
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'
Best Marco