Several problems building wxPython on Fedora 39

,

Hello,

first of all: I’m a noob - I guess. I tried to install a minecraft world editor (Amulet). It failed because of a wheel problem for wxPython. I then tried to build wxPython on Fedora 39 because the wheel doesn’t exist for F39 so far, only F38. I followed this guide here: Building wxPython for Linux via Pip | wxPython
And I installed all these packages with these commands:
sudo dnf install python3.9
sudo dnf install python3-devtools
sudo dnf install gtk3
sudo dnf install gtk3-devel
sudo dnf install gstreamer1
sudo dnf install gstreamer1-devel
sudo dnf install gstreamer1-plugins-base
sudo dnf install gstreamer1-plugins-base-devel
sudo dnf install ghc-GLUT
sudo dnf install ghc-GLUT-devel
sudo dnf install webkit2gtk4.0
sudo dnf install webkit2gtk4.0-devel
sudo dnf install libjpeg
sudo dnf install libjpeg-devel
sudo dnf install libpng
sudo dnf install libpng-devel
sudo dnf install libtiff
sudo dnf install libtiff-devel
sudo yum install SDL* (includes packages & devel packages)
sudo dnf install libnotify
sudo dnf install libnotify-devel
sudo dnf install libSM
sudo dnf install libSM-devel
sudo dnf update

My build-log:

> Processing ./wxPython-4.2.1.tar.gz
>   File was already downloaded /home/annatar/tmp-build-wxpython/wxPython-4.2.1.tar.gz
>   Preparing metadata (setup.py): started
>   Running command python setup.py egg_info
>   running egg_info
>   creating /tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info
>   writing /tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info/PKG-INFO
>   writing dependency_links to /tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info/dependency_links.txt
>   writing entry points to /tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info/entry_points.txt
>   writing requirements to /tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info/requires.txt
>   writing top-level names to /tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info/top_level.txt
>   writing manifest file '/tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info/SOURCES.txt'
>   reading manifest file '/tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info/SOURCES.txt'
>   reading manifest template 'MANIFEST.in'
>   no previously-included directories found matching 'docs/sphinx/build'
>   warning: no previously-included files matching '.git' found under directory 'wx'
>   warning: no previously-included files matching '*.pyc' found under directory 'wx'
>   warning: no previously-included files matching '__pycache__' found under directory 'wx'
>   adding license file 'LICENSE.txt'
>   writing manifest file '/tmp/pip-pip-egg-info-m7ar2kvq/wxPython.egg-info/SOURCES.txt'
>   Preparing metadata (setup.py): finished with status 'done'
> Collecting pillow (from wxPython==4.2.1)
>   File was already downloaded /home/annatar/tmp-build-wxpython/pillow-10.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
> Collecting six (from wxPython==4.2.1)
>   File was already downloaded /home/annatar/tmp-build-wxpython/six-1.16.0-py2.py3-none-any.whl
> Collecting numpy (from wxPython==4.2.1)
>   File was already downloaded /home/annatar/tmp-build-wxpython/numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
> Building wheels for collected packages: wxPython
>   Building wheel for wxPython (setup.py): started
>   Running command python setup.py bdist_wheel
>   running bdist_wheel
>   running build
>   WARNING: Building this way assumes that all generated files have been
>   generated already.  If that is not the case then use build.py directly
>   to generate the source and perform the build stage.  You can use
>   --skip-build with the bdist_* or install commands to avoid this
>   message and the wxWidgets and Phoenix build steps in the future.
> 
>   "/home/annatar/tmp-build-wxpython/builder_py/bin/python3.9" -u build.py build
>   /tmp/pip-req-build-rrh8uphx/build.py:43: DeprecationWarning: dep_util is Deprecated. Use functions from setuptools instead.
>     from distutils.dep_util import newer, newer_group
>   Will build using: "/home/annatar/tmp-build-wxpython/builder_py/bin/python3.9"
>   3.9.18 (main, Dec 18 2023, 00:00:00)
>   [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)]
>   Python's architecture is 64bit
>   cfg.VERSION: 4.2.1
> 
>   Running command: build
>   Running command: build_wx
>   wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
>   Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
>   /tmp/pip-req-build-rrh8uphx/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
>   checking build system type... x86_64-pc-linux-gnu
>   checking host system type... x86_64-pc-linux-gnu
>   checking for toolkit... gtk
>   checking for gcc... gcc
>   checking whether the C compiler works... yes
>   checking for C compiler default output file name... a.out
>   checking for suffix of executables...
>   checking whether we are cross compiling... no
>   checking for suffix of object files... o
>   checking whether we are using the GNU C compiler... yes
>   checking whether gcc accepts -g... yes
>   checking for gcc option to accept ISO C89... none needed
>   checking whether we are using the Intel C compiler... no
>   checking how to run the C preprocessor... gcc -E
>   checking for grep that handles long lines and -e... /usr/bin/grep
>   checking for egrep... /usr/bin/grep -E
>   checking whether gcc needs -traditional... no
>   checking for g++... g++
>   checking whether we are using the GNU C++ compiler... yes
>   checking whether g++ accepts -g... yes
>   checking whether we are using the Intel C++ compiler... no
>   checking whether we are using the Sun C++ compiler... no
>   checking for ar... ar
>   checking for ANSI C header files... yes
>   checking for sys/types.h... yes
>   checking for sys/stat.h... yes
>   checking for stdlib.h... yes
>   checking for string.h... yes
>   checking for memory.h... yes
>   checking for strings.h... yes
>   checking for inttypes.h... yes
>   checking for stdint.h... yes
>   checking for unistd.h... yes
>   checking for langinfo.h... yes
>   checking for wchar.h... yes
>   checking for sys/select.h... yes
>   checking for cxxabi.h... yes
>   checking for an ANSI C-conforming const... yes
>   checking for inline... inline
>   checking size of short... 2
>   checking size of void *... 8
>   checking size of int... 4
>   checking size of long... 8
>   checking size of size_t... 8
>   checking size of long long... 8
>   checking size of wchar_t... 4
>   checking for va_copy... yes
>   checking for _FILE_OFFSET_BITS value needed for large files... 64
>   checking if large file support is available... yes
>   checking for _LARGEFILE_SOURCE value needed for large files... no
>   checking whether byte ordering is bigendian... no
>   checking for std::wstring in <string>... yes
>   checking for std::istream... yes
>   checking for std::ostream... yes
>   checking for type_traits... yes
>   checking for __sync_xxx_and_fetch builtins... yes
>   checking for libraries directories... /usr/lib64
>   checking for cos... no
>   checking for floor... no
>   checking if floating point functions link without -lm... no
>   checking for sin... yes
>   checking for ceil... yes
>   checking if floating point functions link with -lm... yes
>   checking for strtoull... yes
>   checking for pkg-config... /home/linuxbrew/.linuxbrew/bin/pkg-config
>   checking pkg-config is at least version 0.9.0... yes
>   checking for LIBPCRE... checking whether pcre submodule exists... yes
>   checking for zlib.h >= 1.1.4... yes
>   checking for zlib.h... (cached) yes
>   checking for deflate in -lz... yes
>   checking for png.h > 0.90... yes
>   checking for png.h... (cached) yes
>   checking for png_sig_cmp in -lpng... yes
>   checking for jpeglib.h... yes
>   checking for jpeg_read_header in -ljpeg... yes
>   checking for jbg_dec_init in -ljbig... no
>   checking for LIBTIFF... not found via pkg-config
>   checking for tiffio.h... yes
>   checking for TIFFError in -ltiff... yes
>   checking for expat.h... no
>   configure: WARNING: system expat library not found, will use built-in instead
>   checking whether expat.h file exists... yes
>   checking for gcc option to accept ISO C99... none needed
>   checking for LIBCURL... not found
>   checking for GTK+ version...
>   checking for pkg-config... (cached) /home/linuxbrew/.linuxbrew/bin/pkg-config
>   checking pkg-config is at least version 0.16... yes
>   checking for GTK+ - version >= 3.0.0... Package gtk+-3.0 was not found in the pkg-config search path.
>   Perhaps you should add the directory containing `gtk+-3.0.pc'
>   to the PKG_CONFIG_PATH environment variable
>   No package 'gtk+-3.0' found
>   Package gthread-2.0 was not found in the pkg-config search path.
>   Perhaps you should add the directory containing `gthread-2.0.pc'
>   to the PKG_CONFIG_PATH environment variable
>   No package 'gthread-2.0' found
>   no
>   *** Could not run GTK+ test program, checking why...
>   *** The test program failed to compile or link. See the file config.log for the
>   *** exact error that occurred. This usually means GTK+ is incorrectly installed.
>   configure: error:
>   The development files for GTK+ were not found. For GTK+ 2, please
>   ensure that pkg-config is in the path and that gtk+-2.0.pc is
>   installed. For GTK+ 1.2 please check that gtk-config is in the path,
>   and that the version is 1.2.3 or above. Also check that the
>   libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
>   --libs' are in the LD_LIBRARY_PATH or equivalent.
> 
>   Error running configure
>   ERROR: failed building wxWidgets
>   Traceback (most recent call last):
>     File "/tmp/pip-req-build-rrh8uphx/build.py", line 1563, in cmd_build_wx
>       wxbuild.main(wxDir(), build_options)
>     File "/tmp/pip-req-build-rrh8uphx/buildtools/build_wxwidgets.py", line 379, in main
>       exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
>     File "/tmp/pip-req-build-rrh8uphx/buildtools/build_wxwidgets.py", line 72, in exitIfError
>       raise builder.BuildError(msg)
>   buildtools.builder.BuildError: Error running configure
>   Finished command: build_wx (0m8.257s)
>   Finished command: build (0m8.257s)
>   Command '"/home/annatar/tmp-build-wxpython/builder_py/bin/python3.9" -u build.py build' failed with exit code 1.
>   error: subprocess-exited-with-error
>   
>   × python setup.py bdist_wheel did not run successfully.
>   │ exit code: 1
>   ╰─> See above for output.
>   
>   note: This error originates from a subprocess, and is likely not a problem with pip.
>   full command: /home/annatar/tmp-build-wxpython/builder_py/bin/python3.9 -u -c '
>   exec(compile('"'"''"'"''"'"'
>   # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
>   #
>   # - It imports setuptools before invoking setup.py, to enable projects that directly
>   #   import from `distutils.core` to work with newer packaging standards.
>   # - It provides a clear error message when setuptools is not installed.
>   # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
>   #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
>   #     manifest_maker: standard file '"'"'-c'"'"' not found".
>   # - It generates a shim setup.py, for handling setup.cfg-only projects.
>   import os, sys, tokenize
>   
>   try:
>       import setuptools
>   except ImportError as error:
>       print(
>           "ERROR: Can not execute `setup.py` since setuptools is not available in "
>           "the build environment.",
>           file=sys.stderr,
>       )
>       sys.exit(1)
>   
>   __file__ = %r
>   sys.argv[0] = __file__
>   
>   if os.path.exists(__file__):
>       filename = __file__
>       with tokenize.open(__file__) as f:
>           setup_py_code = f.read()
>   else:
>       filename = "<auto-generated setuptools caller>"
>       setup_py_code = "from setuptools import setup; setup()"
>   
>   exec(compile(setup_py_code, filename, "exec"))
>   '"'"''"'"''"'"' % ('"'"'/tmp/pip-req-build-rrh8uphx/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-68pfq0lp
>   cwd: /tmp/pip-req-build-rrh8uphx/
>   Building wheel for wxPython (setup.py): finished with status 'error'
>   ERROR: Failed building wheel for wxPython
>   Running setup.py clean for wxPython
>   Running command python setup.py clean
>   running clean
>   'build/lib.linux-x86_64-cpython-39' does not exist -- can't clean it
>   'build/bdist.linux-x86_64' does not exist -- can't clean it
>   'build/scripts-3.9' does not exist -- can't clean it
> Failed to build wxPython
> ERROR: Failed to build one or more wheels

Any idea how to fix it? Or even any “step by step” solution?

Fedora 39 has:

Available Packages
Name         : python3-wxpython4
Version      : 4.2.1
Release      : 3.fc39
Architecture : x86_64
Size         : 9.5 M
Source       : python-wxpython4-4.2.1-3.fc39.src.rpm
Repository   : fedora
Summary      : New implementation of wxPython, a GUI toolkit for Python
URL          : https://www.wxpython.org/
License      : wxWidgets and BSD
Description  : wxPython4 is a is a new implementation of wxPython focused on
             : improving speed, maintainability and extensibility. Just like
             : "Classic" wxPython it wraps the wxWidgets C++ toolkit and
             : provides access to the user interface portions of the wx API,
             : enabling Python applications to have a GUI on Windows, Macs or
             : Unix systems with a native look and feel and requiring very
             : little (if any) platform specific code.

It looks like you downloaded the tarball package:

wxPython-4.2.1.tar.gz

But you can find this packge on Fedora repos:

sudo dnf info python3-wxpython4
Última verificação de metadados: 0:54:01 atrás em qui 08 fev 2024 13:33:51.
Pacotes disponíveis
Nome         : python3-wxpython4
Versão       : 4.2.1
Lançamento   : 3.fc39
Arquitetura  : x86_64
Tamanho      : 9.5 M
Origem       : python-wxpython4-4.2.1-3.fc39.src.rpm
Repositório  : fedora
Resumo       : New implementation of wxPython, a GUI toolkit for Python
URL          : https://www.wxpython.org/
Licença      : wxWidgets and BSD
Descrição    : wxPython4 is a is a new implementation of wxPython focused on improving speed,
             : maintainability and extensibility. Just like "Classic" wxPython it wraps the
             : wxWidgets C++ toolkit and provides access to the user interface portions of the
             : wx API, enabling Python applications to have a GUI on Windows, Macs or Unix
             : systems with a native look and feel and requiring very little (if any) platform
             : specific code.

Also, Fedora already ships with the latest Python, version 3.12. Is there any reason to install an older version?

You can try installing the package, since that will solve any dependency problem, which it looks like the problem with the gtk versions.

It also looks like it needs Python pip package installer, you can also find an install from the repos:

sudo dnf info python3-pip
Última verificação de metadados: 1:02:23 atrás em qui 08 fev 2024 13:33:51.
Pacotes instalados
Nome         : python3-pip
Versão       : 23.2.1
Lançamento   : 1.fc39
Arquitetura  : noarch
Tamanho      : 14 M
Origem       : python-pip-23.2.1-1.fc39.src.rpm
Repositório  : @System
A partir do  : fedora
Resumo       : A tool for installing and managing Python3 packages
URL          : https://pip.pypa.io/
Licença      : MIT AND Python-2.0.1 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause)
Descrição    : pip is a package management system used to install and manage software packages
             : written in Python. Many packages can be found in the Python Package Index
             : (PyPI). pip is a recursive acronym that can stand for either "Pip Installs
             : Packages" or "Pip Installs Python".

So, I never used this software, but the packages needed to build it, Fedora does have it. Maybe start from the packages that Fedora has and see if it works.

Edit: It looks like @gnwiii already give the answer faster than me. :slightly_smiling_face:

Hello,

thank you both for your replies. I’m currently very frustrated because it looks like I’ve totally done a mess with my system. I tried to install this amulet editor for like ~6-7 hours and I still wasn’t able to make it work. It’s enough for today even if it’s really annoying that I couldn’t solve it so far. I don’t know how to use the last two packages to run / install this amulet editor (https://www.amuletmc.com/).

Kind Regards!

You can install wxPython wheels for Fedora this way:

pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-38/ wxPython

The wheels are for Fedora 38 but works for 39.

https://github.com/Amulet-Team/Amulet-Map-Editor says:

  1. Install Python 3.9+
  2. We recommend setting up a python virtual environment so you don’t run into issues with dependency conflicts.
  3. run python -m pip install amulet-map-editor to install the library and all its dependencies.
  4. run python -m amulet_map_editor to run the program

Looks like many linux users experience UI problems.

Fedora comes with Python-3.12, which breaks many older Python packages. Fedora provides a large range of older Python versions:

% doas dnf search python3\. | grep -E "x86_64.*interpreter"
Last metadata expiration check: 3:17:08 ago on Thu Feb  8 11:18:45 2024.
python3.10.x86_64 : Version 3.10 of the Python interpreter
python3.11.x86_64 : Version 3.11 of the Python interpreter
python3.13.x86_64 : Version 3.13 of the Python interpreter
python3.6.x86_64 : Version 3.6 of the Python interpreter
python3.7.x86_64 : Version 3.7 of the Python interpreter
python3.8.x86_64 : Version 3.8 of the Python interpreter
python3.9.x86_64 : Version 3.9 of the Python interpreter

Hello,

thanks for your reply. I tried it and it unfortunately didn’t work. This is the log file.

(python3.9-venv-amulet) annatar@fedora:~$ pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-38/ wxPython
Looking in links: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/fedora-38/
Collecting wxPython
  Downloading wxPython-4.2.1.tar.gz (73.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.7/73.7 MB 1.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pillow (from wxPython)
  Downloading pillow-10.2.0-cp39-cp39-manylinux_2_28_x86_64.whl.metadata (9.7 kB)
Collecting six (from wxPython)
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting numpy (from wxPython)
  Downloading numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.0/61.0 kB 732.6 kB/s eta 0:00:00
Downloading numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 1.0 MB/s eta 0:00:00
Downloading pillow-10.2.0-cp39-cp39-manylinux_2_28_x86_64.whl (4.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 MB 973.3 kB/s eta 0:00:00
Building wheels for collected packages: wxPython
  Building wheel for wxPython (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for wxPython (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [142 lines of output]
      running bdist_wheel
      running build
      /tmp/pip-install-r_5kc7cz/wxpython_377973a843624634aa9d64dbcbe1f8d1/build.py:43: DeprecationWarning: dep_util is Deprecated. Use functions from setuptools instead.
        from distutils.dep_util import newer, newer_group
      Will build using: "/home/annatar/python3.9-venv-amulet/bin/python3.9"
      3.9.18 (main, Dec 18 2023, 00:00:00)
      [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.1
      
      Running command: build
      Running command: build_wx
      wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
      Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
      /tmp/pip-install-r_5kc7cz/wxpython_377973a843624634aa9d64dbcbe1f8d1/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
      checking build system type... x86_64-pc-linux-gnu
      checking host system type... x86_64-pc-linux-gnu
      checking for toolkit... gtk
      checking for gcc... gcc
      checking whether the C compiler works... yes
      checking for C compiler default output file name... a.out
      checking for suffix of executables...
      checking whether we are cross compiling... no
      checking for suffix of object files... o
      checking whether we are using the GNU C compiler... yes
      checking whether gcc accepts -g... yes
      checking for gcc option to accept ISO C89... none needed
      checking whether we are using the Intel C compiler... no
      checking how to run the C preprocessor... gcc -E
      checking for grep that handles long lines and -e... /usr/bin/grep
      checking for egrep... /usr/bin/grep -E
      checking whether gcc needs -traditional... no
      checking for g++... g++
      checking whether we are using the GNU C++ compiler... yes
      checking whether g++ accepts -g... yes
      checking whether we are using the Intel C++ compiler... no
      checking whether we are using the Sun C++ compiler... no
      checking for ar... ar
      checking for ANSI C header files... yes
      checking for sys/types.h... yes
      checking for sys/stat.h... yes
      checking for stdlib.h... yes
      checking for string.h... yes
      checking for memory.h... yes
      checking for strings.h... yes
      checking for inttypes.h... yes
      checking for stdint.h... yes
      checking for unistd.h... yes
      checking for langinfo.h... yes
      checking for wchar.h... yes
      checking for sys/select.h... yes
      checking for cxxabi.h... yes
      checking for an ANSI C-conforming const... yes
      checking for inline... inline
      checking size of short... 2
      checking size of void *... 8
      checking size of int... 4
      checking size of long... 8
      checking size of size_t... 8
      checking size of long long... 8
      checking size of wchar_t... 4
      checking for va_copy... yes
      checking for _FILE_OFFSET_BITS value needed for large files... 64
      checking if large file support is available... yes
      checking for _LARGEFILE_SOURCE value needed for large files... no
      checking whether byte ordering is bigendian... no
      checking for std::wstring in <string>... yes
      checking for std::istream... yes
      checking for std::ostream... yes
      checking for type_traits... yes
      checking for __sync_xxx_and_fetch builtins... yes
      checking for libraries directories... /usr/lib64
      checking for cos... no
      checking for floor... no
      checking if floating point functions link without -lm... no
      checking for sin... yes
      checking for ceil... yes
      checking if floating point functions link with -lm... yes
      checking for strtoull... yes
      checking for pkg-config... /home/linuxbrew/.linuxbrew/bin/pkg-config
      checking pkg-config is at least version 0.9.0... yes
      checking for LIBPCRE... checking whether pcre submodule exists... yes
      checking for zlib.h >= 1.1.4... yes
      checking for zlib.h... (cached) yes
      checking for deflate in -lz... yes
      checking for png.h > 0.90... yes
      checking for png.h... (cached) yes
      checking for png_sig_cmp in -lpng... yes
      checking for jpeglib.h... yes
      checking for jpeg_read_header in -ljpeg... yes
      checking for jbg_dec_init in -ljbig... no
      checking for LIBTIFF... not found via pkg-config
      checking for tiffio.h... yes
      checking for TIFFError in -ltiff... yes
      checking for expat.h... no
      configure: WARNING: system expat library not found, will use built-in instead
      checking whether expat.h file exists... yes
      checking for gcc option to accept ISO C99... none needed
      checking for LIBCURL... not found
      checking for GTK+ version...
      checking for pkg-config... (cached) /home/linuxbrew/.linuxbrew/bin/pkg-config
      checking pkg-config is at least version 0.16... yes
      checking for GTK+ - version >= 3.0.0... Package gtk+-3.0 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `gtk+-3.0.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'gtk+-3.0' found
      Package gthread-2.0 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `gthread-2.0.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'gthread-2.0' found
      no
      *** Could not run GTK+ test program, checking why...
      *** The test program failed to compile or link. See the file config.log for the
      *** exact error that occurred. This usually means GTK+ is incorrectly installed.
      configure: error:
      The development files for GTK+ were not found. For GTK+ 2, please
      ensure that pkg-config is in the path and that gtk+-2.0.pc is
      installed. For GTK+ 1.2 please check that gtk-config is in the path,
      and that the version is 1.2.3 or above. Also check that the
      libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
      --libs' are in the LD_LIBRARY_PATH or equivalent.
      
      Error running configure
      ERROR: failed building wxWidgets
      Traceback (most recent call last):
        File "/tmp/pip-install-r_5kc7cz/wxpython_377973a843624634aa9d64dbcbe1f8d1/build.py", line 1563, in cmd_build_wx
          wxbuild.main(wxDir(), build_options)
        File "/tmp/pip-install-r_5kc7cz/wxpython_377973a843624634aa9d64dbcbe1f8d1/buildtools/build_wxwidgets.py", line 379, in main
          exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
        File "/tmp/pip-install-r_5kc7cz/wxpython_377973a843624634aa9d64dbcbe1f8d1/buildtools/build_wxwidgets.py", line 72, in exitIfError
          raise builder.BuildError(msg)
      buildtools.builder.BuildError: Error running configure
      Finished command: build_wx (0m9.478s)
      Finished command: build (0m9.478s)
      WARNING: Building this way assumes that all generated files have been
      generated already.  If that is not the case then use build.py directly
      to generate the source and perform the build stage.  You can use
      --skip-build with the bdist_* or install commands to avoid this
      message and the wxWidgets and Phoenix build steps in the future.
      
      "/home/annatar/python3.9-venv-amulet/bin/python3.9" -u build.py build
      Command '"/home/annatar/python3.9-venv-amulet/bin/python3.9" -u build.py build' failed with exit code 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for wxPython
Failed to build wxPython
ERROR: Could not build wheels for wxPython, which is required to install pyproject.toml-based projects

Thanks for your reply. And that’s why they also recommend to make a virtual environment with Python 3.9. Wasn’t there somehow an option for python venv to be “fully independent of the system’ Python installation”? Was it “–system-site-packages” set to false? I don’t know if that has any use if I’d setup a new python venv.

Unfortunately, “manylinux” wheels is not “everylinux”. https://wxpython.org/pages/downloads/index.html mentions other options.

The log messages indicate that the gtk3-devel package is not installed. The configure script also looks for, but does not find, expat-devel and libcurl-devel, but those don’t seem to be fatal errors.

Note that the instructions you linked in your very first post were last updated in 2018.

Fedora 39 runs python 3.12 which is not compatible with python 3.11 and earlier. Many of the packages you installed may not be compatible with python 3.12, and certainly you probably should remove python 3.9.

I have wxpython installed on my fedora 39 machine and it works as intended.

I installed wheel with dnf install python3-wheel
then I installed wxpython with dnf install python3-wxpython4* which pulled in all the required pieces and created the wheel for wxpython.

Hello Jerry,

thank you for your reply. I’ve installed gtk3-devel. The other two - I didn’t install them I guess. The configure script…is…kinda “weird” - I don’t want to talk bad about it but it should actually use the e.g. within delivered wxPython from the OS. Anyway, for that I’ll ask @computersavvy if there’s a way how to let the script use the OS’ default wxPython. If that won’t work, I’m going to come back to you.

Kind Regards

Hello Jeff,

thanks for your response. I’m going to make a rollback relatively soon so that I’m not having the by me created system mess anymore.

Afterwards I’m going to install the things you’ve said.

Then I’ll probably face the same problems again because the amulet install script tries to build wxPython by itself. Maybe I have to contact the dev or maybe I have to modify the script?

If you would maybe know how I can use the default packages from Fedora for the amulet installation script, then I’d be glad to know it.

Kind Regards

If wxPython is already installed the script should recognize that and continue without problems. I have not tried amulet so I cannot confirm, but I do use other packages which require wxPython and they recognized the system installed version and installed successfully.

The only potential problem I see is that there may be calls within amulet that are not compatible with python 3.12 which may require a lower python version and that may then require a venv install of the lower python version.

Your question was about wxPython so that is the approach I used in my suggestion.

Note that in a venv you can use a python version that is different than what is installed on the system since the venv is in the users environment. Mixing different versions on the actual system may result in problems with mixed modules/libraries and overall conflicts.

Also note that the amulet script should only try to build/install wxpython if it does not find it already installed.

Hello Jeff,

thanks for your reply. I made a rollback to uninstall all these useless installed packages. Instead I’ve done these steps - including yours - and I was able to fix the wxPython problem (don’t wonder that it looks like a guide the content I will post because it is a guide for later use e.g. when i freshly install a newer fedora version):

1. https://github.com/Amulet-Team/Amulet-Map-Editor AND https://www.amuletmc.com/installing-from-source
2. pip cache purge
3. sudo dnf install python3-numpy
4. sudo dnf install python3-wheel
5. sudo dnf install python3-wxpython4*
6. sudo dnf install python3-pyopengl
X. ...

Afterwards I tried to install Amulet again python -m pip install amulet-map-editor. But I got some new errors. I think I still miss some packages? This is a part of the log file because I couldn’t send everything (more than 32000, was like 162000):

Building wheels for collected packages: amulet-map-editor, amulet-nbt, amulet-leveldb, mutf8
  Building wheel for amulet-map-editor (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for amulet-map-editor (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [1159 lines of output]

**STUFF**

      gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fPIC -I/tmp/pip-build-env-zvje49i6/overlay/lib64/python3.12/site-packages/numpy/core/include -I/usr/include/python3.12 -c amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.c -o build/temp.linux-x86_64-cpython-312/amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.o
      amulet_map_editor/api/opengl/mesh/level/chunk/chunk_builder_cy.c:31:10: fatal error: Python.h: No such file or directory
         31 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for amulet-map-editor
  Building wheel for amulet-nbt (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for amulet-nbt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]

**STUFF**

      gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fPIC -I/tmp/pip-build-env-uwkq24n3/overlay/lib64/python3.12/site-packages/numpy/core/include -I/usr/include/python3.12 -c amulet_nbt/_array.c -o build/temp.linux-x86_64-cpython-312/amulet_nbt/_array.o
      amulet_nbt/_array.c:29:10: fatal error: Python.h: No such file or directory
         29 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for amulet-nbt
  Building wheel for amulet-leveldb (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for amulet-leveldb (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [82 lines of output]

**STUFF**

      gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fPIC -DLEVELDB_PLATFORM_POSIX -DDLLX= -Izlib -Ileveldb-mcpe -Ileveldb-mcpe/include -I/usr/include/python3.12 -c ./leveldb-mcpe/util/options.cc -o build/temp.linux-x86_64-cpython-312/./leveldb-mcpe/util/options.o -std=c++17
      gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fPIC -DLEVELDB_PLATFORM_POSIX -DDLLX= -Izlib -Ileveldb-mcpe -Ileveldb-mcpe/include -I/usr/include/python3.12 -c ./leveldb-mcpe/util/status.cc -o build/temp.linux-x86_64-cpython-312/./leveldb-mcpe/util/status.o -std=c++17
      gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fPIC -DLEVELDB_PLATFORM_POSIX -DDLLX= -Izlib -Ileveldb-mcpe -Ileveldb-mcpe/include -I/usr/include/python3.12 -c ./src/leveldb/_leveldb.cpp -o build/temp.linux-x86_64-cpython-312/./src/leveldb/_leveldb.o -std=c++17
      ./src/leveldb/_leveldb.cpp:106:10: fatal error: Python.h: No such file or directory
        106 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for amulet-leveldb
  Building wheel for mutf8 (setup.py) ... done
  Created wheel for mutf8: filename=mutf8-1.0.6-cp312-cp312-linux_x86_64.whl size=4885 sha256=59cf79ddf304d4214d4f74080ee80ba392aeb1ca246fb64da885ef45d55bad5f
  Stored in directory: /home/annatar/.cache/pip/wheels/c2/2a/80/4c1ef20c67de151e7de0f1d4168f9a7e26c75d54403c6114a8
Successfully built mutf8
Failed to build amulet-map-editor amulet-nbt amulet-leveldb
ERROR: Could not build wheels for amulet-map-editor, amulet-nbt, amulet-leveldb, which is required to install pyproject.toml-based projects

Having trimmed the bulk of the output it seems you may have removed the critical parts that could have told us exactly what was missing. I only see the part that indicates Python.h as potentially missing since it appears in all the snippets you did post.

Did you by chance install python3-devel. That package contains the needed Python.h file.

1 Like

This solved it! It had no errors anymore! Thank you, and thank you all the others for all your effort and help - it’s not self-evident you do this for me/us all!
Here’s the final guide - maybe others will need it + the log file:
Guide - Install Amulet Map Editor on Fedora (39):

1. https://github.com/Amulet-Team/Amulet-Map-Editor AND https://www.amuletmc.com/installing-from-source
2. pip cache purge
3. sudo dnf install python3-devel
4. sudo dnf install python3-numpy
5. sudo dnf install python3-wheel
6. sudo dnf install python3-wxpython4*
7. sudo dnf install python3-pyopengl

Log-File:

Defaulting to user installation because normal site-packages is not writeable
Collecting amulet-map-editor
  Downloading amulet-map-editor-0.10.27.tar.gz (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 840.9 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: Pillow>=10.0.1 in /usr/lib64/python3.12/site-packages (from amulet-map-editor) (10.2.0)
Requirement already satisfied: wxPython in /usr/lib64/python3.12/site-packages (from amulet-map-editor) (4.2.1)
Requirement already satisfied: numpy~=1.17 in /usr/lib64/python3.12/site-packages (from amulet-map-editor) (1.24.4)
Requirement already satisfied: pyopengl~=3.0 in /usr/lib/python3.12/site-packages (from amulet-map-editor) (3.1.7)
Requirement already satisfied: packaging in /usr/lib/python3.12/site-packages (from amulet-map-editor) (23.1)
Collecting amulet-core~=1.9 (from amulet-map-editor)
  Downloading amulet_core-1.9.21-py3-none-any.whl.metadata (4.3 kB)
Collecting amulet-nbt~=2.0 (from amulet-map-editor)
  Downloading amulet-nbt-2.1.2.tar.gz (1.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 733.9 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pymctranslate~=1.2 (from amulet-map-editor)
  Downloading PyMCTranslate-1.2.22-py3-none-any.whl.metadata (2.2 kB)
Collecting minecraft-resource-pack~=1.3 (from amulet-map-editor)
  Downloading minecraft_resource_pack-1.4.1-py3-none-any.whl.metadata (892 bytes)
Collecting platformdirs~=3.1 (from amulet-map-editor)
  Downloading platformdirs-3.11.0-py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: pyopengl-accelerate~=3.0 in /usr/lib64/python3.12/site-packages (from amulet-map-editor) (3.1.7)
Collecting portalocker~=2.4 (from amulet-core~=1.9->amulet-map-editor)
  Downloading portalocker-2.8.2-py3-none-any.whl.metadata (8.5 kB)
Collecting amulet-leveldb~=1.0b0 (from amulet-core~=1.9->amulet-map-editor)
  Downloading amulet-leveldb-1.0.0b5.tar.gz (749 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 749.2/749.2 kB 709.6 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting mutf8~=1.0 (from amulet-nbt~=2.0->amulet-map-editor)
  Downloading mutf8-1.0.6.tar.gz (6.4 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: six in /usr/lib/python3.12/site-packages (from wxPython->amulet-map-editor) (1.16.0)
Downloading amulet_core-1.9.21-py3-none-any.whl (272 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 273.0/273.0 kB 653.5 kB/s eta 0:00:00
Downloading minecraft_resource_pack-1.4.1-py3-none-any.whl (442 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 442.4/442.4 kB 743.9 kB/s eta 0:00:00
Downloading platformdirs-3.11.0-py3-none-any.whl (17 kB)
Downloading PyMCTranslate-1.2.22-py3-none-any.whl (1.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 775.5 kB/s eta 0:00:00
Downloading portalocker-2.8.2-py3-none-any.whl (17 kB)
Building wheels for collected packages: amulet-map-editor, amulet-nbt, amulet-leveldb, mutf8
  Building wheel for amulet-map-editor (pyproject.toml) ... done
  Created wheel for amulet-map-editor: filename=amulet_map_editor-0.10.27-cp312-cp312-linux_x86_64.whl size=2124159 sha256=22609053144c6cb0978d5fcbbc1df09b2741c0e29be77c881decc16d653a0327
  Stored in directory: /home/annatar/.cache/pip/wheels/14/08/b2/c44297de23ed6c0c1ab84799dd1d37eb3ada7687d9ee6067b8
  Building wheel for amulet-nbt (pyproject.toml) ... done
  Created wheel for amulet-nbt: filename=amulet_nbt-2.1.2-cp312-cp312-linux_x86_64.whl size=1021577 sha256=818afb6b45f60a6172d0d591b46e928ae608efc62af524b0b83c4fe088d5ea2e
  Stored in directory: /home/annatar/.cache/pip/wheels/62/81/3e/b9f8491daeb9755362c1bd9580c60e601d1bb058ab2d99981d
  Building wheel for amulet-leveldb (pyproject.toml) ... done
  Created wheel for amulet-leveldb: filename=amulet_leveldb-1.0.0b5-cp312-cp312-linux_x86_64.whl size=369527 sha256=c662e9b159ceb2ed3705337e3f72c6d387d267a7014b51bacc071c0294f65e85
  Stored in directory: /home/annatar/.cache/pip/wheels/96/40/57/7f1bc7e60f26e1af65656740c7aca7c5c5cc8d0f909c2517fa
  Building wheel for mutf8 (setup.py) ... done
  Created wheel for mutf8: filename=mutf8-1.0.6-cp312-cp312-linux_x86_64.whl size=9837 sha256=4cdf82a0f15bdd7bb35dc39cf6eecffc605ea7310fc0d87af17cf45883ab16f5
  Stored in directory: /home/annatar/.cache/pip/wheels/c2/2a/80/4c1ef20c67de151e7de0f1d4168f9a7e26c75d54403c6114a8
Successfully built amulet-map-editor amulet-nbt amulet-leveldb mutf8
Installing collected packages: mutf8, portalocker, platformdirs, amulet-nbt, amulet-leveldb, pymctranslate, minecraft-resource-pack, amulet-core, amulet-map-editor
Successfully installed amulet-core-1.9.21 amulet-leveldb-1.0.0b5 amulet-map-editor-0.10.27 amulet-nbt-2.1.2 minecraft-resource-pack-1.4.1 mutf8-1.0.6 platformdirs-3.11.0 portalocker-2.8.2 pymctranslate-1.2.22

Kind Regards :raised_hands:t2::hugs::smiling_face::innocent: