Upgrade Fedora 40 to 41, Python3.13 issue? OctoPrint fails to run or install

This is a PC dedicated to OctoPrint - no virtual environments - and has been serving well for several years. Just upgraded to Fedora 41, so now it's Python3.13 (honestly, thought I was on a different box when I ran the upgrade. My bad)

Been running Octoprint quite happily for several years now, but after upgrading to Fedora 41, it - not too surprisingly - fails. Running the "pip install --upgrade octoprint" as indicated below.

I'm assuming it's the upgrade from python3.12 (ran fine) to the new python3.13 that's causing problems.

Speculation on my part, as I don't know what the error means:


Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.
β”‚ exit code: 1
╰─> [65 lines of output]
running egg_info
writing lib3/PyYAML.egg-info/PKG-INFO
writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
writing top-level names to lib3/PyYAML.egg-info/top_level.txt
Traceback (most recent call last):
File "/home/ka7o/.local/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
~~~~^^
File "/home/ka7o/.local/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ka7o/.local/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 303, in _get_build_requires
self.run_setup()
~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 319, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File "", line 271, in
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/init.py", line 117, in setup
return distutils.core.setup(**attrs)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 183, in setup
return run_commands(dist)
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
dist.run_commands()
~~~~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
self.run_command(cmd)
~~~~~~~~~~~~~~~~^^^^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
~~~~~~~~~~~^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/command/egg_info.py", line 312, in run
self.find_sources()
~~~~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/command/egg_info.py", line 320, in find_sources
mm.run()
~~~~~~^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/command/egg_info.py", line 541, in run
self.add_defaults()
~~~~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/command/egg_info.py", line 579, in add_defaults
sdist.add_defaults(self)
~~~~~~~~~~~~~~~~~~^^^^^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/command/sdist.py", line 109, in add_defaults
super().add_defaults()
~~~~~~~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/sdist.py", line 238, in add_defaults
self._add_defaults_ext()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/sdist.py", line 323, in _add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "", line 201, in get_source_files
File "/tmp/pip-build-env-e6iddi1s/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 107, in getattr
raise AttributeError(attr)
AttributeError: cython_sources
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— Getting requirements to build 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.

Yup - confirmed. It's a Python3.13 issue

Got around it by using: sudo dnf install python3.12; python3.12 -m pip install --upgrade pip;python3.12 -m pip install --upgrade octoprint

Then launched octoprint with: python3.12 /home/user/.local/bin/octoprint server

where "user" is the user that ran the previous pip and python installs. and all is good again!

Edited the /etc/systemd/system/octoprint.service file to point to python3.12 and everything behaves as usual on power up. Hope this may be a help to any other Fedora user.

But, yes - if you're doing this on a box that's NOT dedicated to just octoprint, use a virtual environment and save yourself this headache.

Still no idea what that python3.13 error message means - maybe someone else?