sage fails to compile on Fedora 43 beta

68 views
Skip to first unread message

Eric Majzoub

unread,
Sep 24, 2025, 5:24:21 PM (2 days ago) Sep 24
to sage-support
I'm trying to compile 10.7 or 10.8.beta4 on Fedora 43 beta. During the build process every package that sagemath wants to download fails with:

AttributeError: module 'urllib.request' has no attribute 'FancyURLopener'

Fedora 43 is using python 3.14.
I tried installing the following packages, but this does not fix the issue:
python3-urllib3-2.5.0-3.fc43.noarch
python3-urllib3+socks-2.5.0-3.fc43.noarch
python3-MultipartPostHandler2-0.1.5-41.fc43.noarch


Dima Pasechnik

unread,
Sep 24, 2025, 6:22:29 PM (2 days ago) Sep 24
to sage-s...@googlegroups.com
We don't have support for Python 3.14 yet.
does Fedora 43 offer a way to install Python 3.13 (as a secondary Python3)  ?

Nils Bruin

unread,
Sep 24, 2025, 8:07:20 PM (2 days ago) Sep 24
to sage-support
dnf install ptyhon3.13

You just need to find a way to tell sage to use python3.13 and not python3.14. There must be a way for that, but I don't know it.

Incidentally, on Fedora 42 there is already the problem that sage doesn't build on gcc15, so you need to install gcc14 and tell sage to build with that; see https://groups.google.com/g/sage-devel/c/tJCbTnelvSg/m/IfzQF0HGBQAJ . I would imagine you'll need to do that on Fedora 43 as well, until gcc15 is fully supported for building sage.

Dima Pasechnik

unread,
Sep 24, 2025, 9:33:09 PM (2 days ago) Sep 24
to sage-s...@googlegroups.com


On September 24, 2025 7:07:20 PM CDT, Nils Bruin <nbr...@sfu.ca> wrote:
>dnf install ptyhon3.13
>
>You just need to find a way to tell sage to use python3.13 and not
>python3.14. There must be a way for that, but I don't know it.

./configure --with-python3=python3.13

should do it

Eric Majzoub

unread,
Sep 25, 2025, 3:59:57 AM (yesterday) Sep 25
to sage-support

I installed python 3.13, and used  
./configure --with-system-python3=python3.13

Still the same error messages. Note: I had no problem building sage 10.7 on Fedora 42 with gcc 15.

Dima Pasechnik

unread,
Sep 25, 2025, 9:38:45 AM (yesterday) Sep 25
to sage-s...@googlegroups.com
This is because rather than using the supplied python3.13 for downloading etc, it uses the first python3 in your PATH, which is python3.14. And in the latter FancyURLopener has been removed.

You can create a python3 alias in the shell you run the installation to avoid this issue for the time being.

alias python3=python3.13



In 2016 I mentioned in one of the issues that FancyURLOpener has deprecated, and has to be looked into. :-)

Anyhow I just opened issue #40886 to deal with it.

HTH
Dima

Dima Pasechnik

unread,
Sep 25, 2025, 2:35:54 PM (yesterday) Sep 25
to sage-s...@googlegroups.com, Eric Majzoub
On Thu, Sep 25, 2025 at 8:38 AM Dima Pasechnik <dim...@gmail.com> wrote:
>
> This is because rather than using the supplied python3.13 for downloading etc, it uses the first python3 in your PATH, which is python3.14. And in the latter FancyURLopener has been removed.
>
> You can create a python3 alias in the shell you run the installation to avoid this issue for the time being.
>
> alias python3=python3.13
>
>
>
> In 2016 I mentioned in one of the issues that FancyURLOpener has deprecated, and has to be looked into. :-)
>
> Anyhow I just opened issue #40886 to deal with it.

The fix proposed here: https://github.com/sagemath/sage/pull/40888

Eric, you could try merging this PR to the latest beta, it should
allow you to build with system python 3.14
(supplying 3.13 to configure, as explained)

Dima

Eric Majzoub

unread,
Sep 25, 2025, 4:12:56 PM (yesterday) Sep 25
to sage-support
Hi Dima: I merged the PR, ran configure with  --with-system-python3=python3.13, and set the alias for python3 in the shell. I still get a failure to build with the same error. The log output for e.g. mpfi is:

cat /home/packages/SOURCE/sage/logs/pkgs/mpfi-1.5.2.log
Attempting to download package mpfi-1.5.2.tar.bz2 from mirrors
https://github.com/sagemath/sage/releases/download/10.8/mpfi-1.5.2.tar.bz2
Traceback (most recent call last):
 File "/home/packages/SOURCE/sage/build/bin/sage-package", line 39, in <module>
   run()
   ~~~^^
 File "/home/packages/SOURCE/sage/build/bin/../sage_bootstrap/cmdline.py", line 538, i
n run
   app.download_cls(*args.package_class,
   ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
                    has_files=args.has_files, no_files=args.no_files,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    exclude=args.exclude,
                    ^^^^^^^^^^^^^^^^^^^^^
                    allow_upstream=args.allow_upstream,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    on_error=args.on_error)
                    ^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/packages/SOURCE/sage/build/bin/../sage_bootstrap/app.py", line 337, in do
wnload_cls
   pc.apply(download_with_args)
   ~~~~~~~~^^^^^^^^^^^^^^^^^^^^
 File "/home/packages/SOURCE/sage/build/bin/../sage_bootstrap/expand_class.py", line 1
26, in apply
   function(package_name, *args, **kwds)
   ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/packages/SOURCE/sage/build/bin/../sage_bootstrap/app.py", line 329, in do
wnload_with_args
   self.download(package, allow_upstream=allow_upstream)
   ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/packages/SOURCE/sage/build/bin/../sage_bootstrap/app.py", line 315, in do
wnload
   package.tarball.download(allow_upstream=allow_upstream)
   ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/packages/SOURCE/sage/build/bin/../sage_bootstrap/tarball.py", line 175, i
n download
   Download(url, destination).run()
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
 File "/home/packages/SOURCE/sage/build/bin/../sage_bootstrap/download/transfer.py", l
ine 123, in run
   opener = urllib.FancyURLopener()
            ^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'urllib.request' has no attribute 'FancyURLopener'
************************************************************************
Error downloading tarball of mpfi

I think I did the merge correctly...
[ehm sage]$ git status
HEAD detached at 10.8.beta4
Changes not staged for commit:
 (use "git add <file>..." to update what will be committed)
 (use "git restore <file>..." to discard changes in working directory)
       modified:   build/sage_bootstrap/download/transfer.py


Dima Pasechnik

unread,
Sep 25, 2025, 4:38:20 PM (yesterday) Sep 25
to sage-s...@googlegroups.com
I meanwhile added one more commit to the PR, as the 1st commit only fixed the downloading, but not extraction.

Anyhow, after a merge you should not see any changed files in "git status"

In short, assuming origin is the name of the Sage remote, and you are on the latest develop (beta) branch, one should do

git pull origin pull/40888/head

and it should automatically do the thing

After also allowing python 3.14,
I am able to build at least parts of the Sage
on Fedora 43, without python 3.13

Dima Pasechnik

unread,
Sep 25, 2025, 5:14:07 PM (yesterday) Sep 25
to sage-support
Here is how to enable Python 3.14:

--- a/build/pkgs/python3/spkg-configure.m4
+++ b/build/pkgs/python3/spkg-configure.m4
@@ -1,8 +1,8 @@
 SAGE_SPKG_CONFIGURE([python3], [
    m4_pushdef([MIN_VERSION],               [3.11.0])
    m4_pushdef([MIN_NONDEPRECATED_VERSION], [3.11.0])
-   m4_pushdef([LT_STABLE_VERSION],         [3.14.0])
-   m4_pushdef([LT_VERSION],                [3.14.0])
+   m4_pushdef([LT_STABLE_VERSION],         [3.15.0])
+   m4_pushdef([LT_VERSION],                [3.15.0])
    AC_ARG_WITH([python],
                [AS_HELP_STRING([--with-python=PYTHON3],
                                [Python 3 executable to use for the Sage venv; default: python3])])


to unbreak the latest beta build

Please see https://github.com/sagemath/sage/issues/40890 (porting to Python 3.14)  for details 

Nils Bruin

unread,
Sep 25, 2025, 6:35:22 PM (yesterday) Sep 25
to sage-support
On Thursday, 25 September 2025 at 06:38:45 UTC-7 dim...@gmail.com wrote:
This is because rather than using the supplied python3.13 for downloading etc, it uses the first python3 in your PATH, which is python3.14. And in the latter FancyURLopener has been removed.

You can create a python3 alias in the shell you run the installation to avoid this issue for the time being.

alias python3=python3.13

so ...  ./configure --with-system-python3=python3.13 does NOT work to build sage with a different python. Would it be possible to fix sage configure to actually be able to configure which python to build with? As this example shows, it's a desirable feature to have. Does that need a ticket? (the alias solution needs to be executed every time and looks like something that should be injected into sage-env or something like that)


Nils Bruin

unread,
Sep 25, 2025, 6:38:14 PM (yesterday) Sep 25
to sage-support
On Thursday, 25 September 2025 at 00:59:57 UTC-7 Eric Majzoub wrote:

I installed python 3.13, and used  
./configure --with-system-python3=python3.13

Still the same error messages. Note: I had no problem building sage 10.7 on Fedora 42 with gcc 15.

Version 10.7 building functionally on on gcc15 is great! There were quite a few issues, some of them quite non-trivial. Those have all been merged then? 

Dima Pasechnik

unread,
Sep 25, 2025, 7:11:07 PM (yesterday) Sep 25
to Nils Bruin, sage-support
I am taking care of this in #40888.
Reviews welcome

I also opened an issue to deal with porting to Python 3.14, #40890

Dima

Nils Bruin

unread,
Sep 25, 2025, 7:23:32 PM (yesterday) Sep 25
to sage-support
On Thursday, 25 September 2025 at 16:11:07 UTC-7 dim...@gmail.com wrote:
I am taking care of this in #40888.
Reviews welcome

I also opened an issue to deal with porting to Python 3.14, #40890

Both those tickets have the laudable goal of getting sage to work with Python 3.13. That absolutely has to happen, so it's great you're working on that.

My request was about another issue:
 
so ...  ./configure --with-system-python3=python3.13 does NOT work to build sage with a different python. Would it be possible to fix sage configure to actually be able to configure which python to build with? As this example shows, it's a desirable feature to have. Does that need a ticket? (the alias solution needs to be executed every time and looks like something that should be injected into sage-env or something like that)

Even though we'd love that sage always supports the latest python as soon as possible, the reality is that one can find oneself in the situation where "python3" on a computer is NOT a python with which sage can work. In that situation, it would be good if there's a workaround: point sage at another python. The proposed "configure" does that probably to some extent, but as observed, there's an additional "alias" required. That needs to stick somehow. Can we make configure do the job? Or is "conda" in that situation the better option (conda goes through great lengths to customize environments where all kinds of system utilities are specifically configured, regardless of the defaults provided by the host.

Getting Python 3.14 supported will put that problem under the radar for a while. Probably until Python 3.15 comes along. But it will pop up again.
 

Dima Pasechnik

unread,
Sep 25, 2025, 8:19:25 PM (24 hours ago) Sep 25
to Nils Bruin, sage-support
#40888 makes sure one can use Python 3.14 to build Sage.

While it would be nice to have an explicit control over Python used for building Sage, I believe it's low priority, particularly as #40888 covers what's needed at least until the distributions start switching to Python 3.15.

Eric Majzoub

unread,
Sep 25, 2025, 10:27:09 PM (22 hours ago) Sep 25
to sage-support
Thank you for the git instructions. This worked for me. I successfully built 10.8.beta4.
Reply all
Reply to author
Forward
0 new messages