Skip to content

Conversation

@cxzhong
Copy link
Contributor

@cxzhong cxzhong commented Dec 4, 2025

When running ./configure with --with-python=pythonX.Y, if a previous
configure run had cached a different Python path in ac_cv_path_PYTHON3,
the cached value would be used instead of re-checking the specified Python.

This fix clears the cache variable when --with-python is explicitly
specified, forcing configure to always check the specified Python.

Fixes #41258

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

When running ./configure with --with-python=pythonX.Y, if a previous
configure run had cached a different Python path in ac_cv_path_PYTHON3,
the cached value would be used instead of re-checking the specified Python.

This fix clears the cache variable when --with-python is explicitly
specified, forcing configure to always check the specified Python.

Fixes sagemath#41258
@cxzhong
Copy link
Contributor Author

cxzhong commented Dec 5, 2025

@dimpase Can you test the issue is solved?

@enriqueartal
Copy link
Contributor

I want to try this to compile sage in F43 with 3.13. As @dimpase pointed out it can be built with 3.14 but these do not pass, even though it can be used. I got:

checking ... whether /usr/bin/python3.13 is good... no, the version is in the supported range but cannot import one of the required modules: sqlite3, ctypes, math, hashlib, socket, ssl, ensurepip, zlib, setuptools, setuptools.extension

@dimpase
Copy link
Member

dimpase commented Dec 5, 2025

I want to try this to compile sage in F43 with 3.13. As @dimpase pointed out it can be built with 3.14 but these do not pass, even though it can be used. I got:

checking ... whether /usr/bin/python3.13 is good... no, the version is in the supported range but cannot import one of the required modules: sqlite3, ctypes, math, hashlib, socket, ssl, ensurepip, zlib, setuptools, setuptools.extension

Have you done dnf install python3.13-devel ?

Hmm, it's probably this:

bash-5.3# dnf install python3-setuptools
Updating and loading repositories:
Repositories loaded.
Package                             Arch      Version                             Repository              Size
Installing:
 python3-setuptools                 noarch    78.1.1-15.fc43                      fedora               9.0 MiB

Transaction Summary:
 Installing:         1 package

Total size of inbound packages is 2 MiB. Need to download 2 MiB.
After this operation, 9 MiB extra will be used (install 9 MiB, remove 0 B).
Is this ok [y/N]: y
[1/1] python3-setuptools-0:78.1.1-15.fc43.noarch                      100% |   5.4 MiB/s |   2.1 MiB |  00m00s
--------------------------------------------------------------------------------------------------------------
[1/1] Total                                                           100% |   2.8 MiB/s |   2.1 MiB |  00m01s
Running transaction
[1/3] Verify package files                                            100% | 200.0   B/s |   1.0   B |  00m00s
[2/3] Prepare transaction                                             100% | 111.0   B/s |   1.0   B |  00m00s
[3/3] Installing python3-setuptools-0:78.1.1-15.fc43.noarch           100% |  86.2 MiB/s |   9.2 MiB |  00m00s
Complete!
bash-5.3# python3.13
Python 3.13.9 (main, Oct 14 2025, 00:00:00) [GCC 15.2.1 20250924 (Red Hat 15.2.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import setuptools
ModuleNotFoundError: No module named 'setuptools'

I must say I don't know Fedora packaging: I see
https://packages.fedoraproject.org/pkgs/python3.13-setuptools/python3.13-setuptools/index.html
but I can't do dnf install python3.13-setuptools, I get No match for argument: python3.13-setuptools

@enriqueartal
Copy link
Contributor

Yes, it installed 4 packages, that one, python3.13, python3.13-libs and python3.13-tkinter.

Have you done dnf install python3.13-devel ?

@dimpase
Copy link
Member

dimpase commented Dec 5, 2025

Yes, it installed 4 packages, that one, python3.13, python3.13-libs and python3.13-tkinter.

Have you done dnf install python3.13-devel ?

can you get python3.13-setuptools installed?

@enriqueartal
Copy link
Contributor

Yes, it installed 4 packages, that one, python3.13, python3.13-libs and python3.13-tkinter.

Have you done dnf install python3.13-devel ?

can you get python3.13-setuptools installed?

How would I? Looking for a previous version?

@dimpase
Copy link
Member

dimpase commented Dec 5, 2025

Yes, it installed 4 packages, that one, python3.13, python3.13-libs and python3.13-tkinter.

Have you done dnf install python3.13-devel ?

can you get python3.13-setuptools installed?

How would I? Looking for a previous version?

No, I don't don't understand why the package is listed here
https://packages.fedoraproject.org/pkgs/python3.13-setuptools/python3.13-setuptools/index.html
but dnf does not get it installed? Is it a Fedora bug, or just something I don't understand?

@enriqueartal
Copy link
Contributor

It is only in EPEL repository.

@dimpase
Copy link
Member

dimpase commented Dec 5, 2025

It is only in EPEL repository.

can one install packages from there in Fedora 43?

@enriqueartal
Copy link
Contributor

I tried unsuccesfully

@dimpase
Copy link
Member

dimpase commented Dec 5, 2025

Yes, it installed 4 packages, that one, python3.13, python3.13-libs and python3.13-tkinter.

Have you done dnf install python3.13-devel ?

can you get python3.13-setuptools installed?

How would I? Looking for a previous version?

No, I don't don't understand why the package is listed here https://packages.fedoraproject.org/pkgs/python3.13-setuptools/python3.13-setuptools/index.html but dnf does not get it installed? Is it a Fedora bug, or just something I don't understand?

@jamesjer - is it normal that Fedora 43 has no fully functional Python 3.13 install? (One can argue that without setuptools package one can't do a lot of Python development)

@jamesjer
Copy link
Contributor

jamesjer commented Dec 5, 2025

Yes, this is normal. On Fedora 43, the system python is version 3.14, and all other python packages were built with 3.14. There is a python3.13 package, but all you get is the bits distributed with python 3.13 itself. If you want other python packages for 3.13, such as setuptools, you have to build them yourself. Those doing python development will normally use python virtual environments to manage the various versions they work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--with-python=python3.x does not work if python3!=python3.x

4 participants