Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.13 support #2640

Open
sanjayankur31 opened this issue Dec 12, 2023 · 3 comments
Open

Python 3.13 support #2640

sanjayankur31 opened this issue Dec 12, 2023 · 3 comments

Comments

@sanjayankur31
Copy link
Contributor

Filing this early because the Fedora Python maintainers have started to test all our packages with Python 3.13, and NEURON does not currently build with it.

https://bugzilla.redhat.com/show_bug.cgi?id=2254189

neuron fails to build with Python 3.13.0a2.

/builddir/build/BUILD/nrn-8.2.2/src/nrnpython/nrnpython.cpp:157:13: error: ‘Py_SetPythonHome’ was not declared in this scope; did you mean ‘Py_GetPythonHome’?
  157 |             Py_SetPythonHome(mywstrdup(_p_pyhome));
      |             ^~~~~~~~~~~~~~~~
      |             Py_GetPythonHome
/builddir/build/BUILD/nrn-8.2.2/src/nrnpython/nrnpython.cpp:165:9: error: ‘PySys_SetArgv’ was not declared in this scope
  165 |         PySys_SetArgv(nrn_global_argc, wcargv);
      |         ^~~~~~~~~~~~~

According to https://docs.python.org/3.13/whatsnew/3.13.html:
Remove the following old functions to configure the Python initialization, deprecated in Python 3.11:

  • PySys_AddWarnOptionUnicode(): use PyConfig.warnoptions instead.
  • PySys_AddWarnOption(): use PyConfig.warnoptions instead.
  • PySys_AddXOption(): use PyConfig.xoptions instead.
  • PySys_HasWarnOptions(): use PyConfig.xoptions instead.
  • PySys_SetArgvEx(): set PyConfig.argv instead.
  • PySys_SetArgv(): set PyConfig.argv instead.
  • PySys_SetPath(): set PyConfig.module_search_paths instead.
  • Py_SetPath(): set PyConfig.module_search_paths instead.
  • Py_SetProgramName(): set PyConfig.program_name instead.
  • Py_SetPythonHome(): set PyConfig.home instead.
  • Py_SetStandardStreamEncoding(): set PyConfig.stdio_encoding instead, and set also maybe PyConfig.legacy_windows_stdio (on Windows).
  • _Py_SetProgramFullPath(): set PyConfig.executable instead.

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06712032-neuron/

For all our attempts to build neuron with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/neuron/

@alkino
Copy link
Member

alkino commented Dec 12, 2023

This is an already known problem. It should not be really long to fix this. Thanks for the report.

@alkino
Copy link
Member

alkino commented Jan 8, 2024

I was giving a try, and I was not able to install the dependencies of nrn with python 3.13. We depend on matplotlib that depends of contourpy that depends of meson.

meson is not yet ready for python 3.13: mesonbuild/meson#12714

Here we are.

@JCGoran
Copy link
Contributor

JCGoran commented Jan 16, 2024

@sanjayankur31 The removal of the initialization functions was fixed in #2317, can you try to re-build with the latest master?

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

No branches or pull requests

3 participants