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 #9413

Closed
sklam opened this issue Jan 31, 2024 · 12 comments · Fixed by #9682
Closed

Python 3.13 #9413

sklam opened this issue Jan 31, 2024 · 12 comments · Fixed by #9682

Comments

@sklam
Copy link
Member

sklam commented Jan 31, 2024

This issue is to track tasks and issues with Python 3.13.

Numba support status:

@sklam sklam pinned this issue Jan 31, 2024
@sklam sklam unpinned this issue Feb 19, 2024
@sklam sklam pinned this issue Feb 19, 2024
@aaronzo
Copy link

aaronzo commented Jun 28, 2024

Great to see some steps towards 3.13 taking place - will numba publish PEP 703 free threading wheels (-cp313t)?

@sklam
Copy link
Member Author

sklam commented Jul 23, 2024

RE: #9413 (comment)

will numba publish PEP 703 free threading wheels (-cp313t)?

We are talking about providing freethreading packages but the current priority is just to get through all the issues with bytecode changes.

As of a8ad12a, the testsuite is at 493 failures out of 10385.

@sklam
Copy link
Member Author

sklam commented Jul 31, 2024

As of 6cafffe, everything is working on py3.13 except for 3 failures that are unrelated to py3.13:

  • numba.tests.test_lists.TestLists.test_mul_error
    • Python3.13 is not raising MemoryError in the hatchery docker.
    • rosetta error: could not find free space for allocation size 1000000000001000
  • numba.tests.test_nrt.TestNrtMemInfo.test_allocate_invalid_size
    • rosetta error: could not find free space for allocation size 2000000000001000
  • numba.tests.test_function_type.TestFunctionTypeExtensions.test_wrapper_address_protocol_libm
    • Fail when running alone. Works when with other tests. Probably due to
      initialization problem.

@jmerkel11
Copy link

Basically the same as aaronzo said, but for PEP 738.
At first thanks for your awesome work, then the question: Will you support numba on Android starting with Python 3.13?
Otherwise, current Android support will likely die ( chaquo/chaquopy#834 ).

@mhsmith
Copy link

mhsmith commented Sep 12, 2024

Hi, I'm the maintainer of Chaquopy. Both myself and the Numba maintainers now work for Anaconda, so we'll hopefully be able to produce Numba builds for Python 3.13 on Android later in the year. But first we'll need to deal with more fundamental packages like NumPy.

@jakirkham
Copy link
Contributor

Think we need llvmlite supported on Python 3.13. Is that being tracked in an issue somewhere as well?

@stuartarchibald
Copy link
Contributor

@jakirkham thanks for the reminder, there is now numba/llvmlite#1084

@slayoo
Copy link

slayoo commented Oct 22, 2024

For the record, since last week's update, the macos-14-arm64 image on GitHub Actions ships with system Python 3.13, which makes Numba uninstallable there as of now

https://newreleases.io/project/github/actions/runner-images/release/macos-14-arm64%2F20241014.301

Shonas301 added a commit to Shonas301/whisper that referenced this issue Oct 26, 2024
*Changes made*

- Update `setup.py` to pass in a local dictionary to `exec` to capture
  the `locals()` in `_version.py` for package version reporting.

*Motivation*

- `Python3.13.0` enforces stricter safety standards on `locals()` with
  PEP 667 (see [here](python/cpython#118888 (comment)))

- This causes the following error upon attempting to install with
  `python3.13 -m pip install openai-whisper`:

```bash
Collecting openai-whisper
  Using cached openai-whisper-20240930.tar.gz (800 kB)
  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
  ╰─> [25 lines of output]
      <string>:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      Traceback (most recent call last):
        File "/Users/jasonshipp/.pyenv/versions/3.13.0/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "/Users/jasonshipp/.pyenv/versions/3.13.0/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 "/Users/jasonshipp/.pyenv/versions/3.13.0/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 "/private/var/folders/hk/8xz63_l16zb9snz57jx9hqgr0000gn/T/pip-build-env-l_19mrvs/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/hk/8xz63_l16zb9snz57jx9hqgr0000gn/T/pip-build-env-l_19mrvs/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/hk/8xz63_l16zb9snz57jx9hqgr0000gn/T/pip-build-env-l_19mrvs/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 516, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/hk/8xz63_l16zb9snz57jx9hqgr0000gn/T/pip-build-env-l_19mrvs/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 21, in <module>
        File "<string>", line 11, in read_version
      KeyError: '__version__'
      [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
```

*EXTRA NOTES*

- This does not enable `openai-whisper` to be pip installed with
  `Python3.13`, due to a dependency on the `numba` library. This issue
  and missing dependency can be tracked [here](numba/numba#9413)
@omegadev21
Copy link

can you give an estimation on when Numba will be ready for python 3.13.0

@jensdebruijn
Copy link

You can install the release candidate right now

@slayoo
Copy link

slayoo commented Dec 7, 2024

Trying out numba-0.61.0rc1 (and llvmlite-0.44.0rc1) on GitHub Actions macOS runners, it works well on Intel macos-13 image, but fails on Apple-silicon (ARM) macos-14 runner with (https://github.com/open-atmos/PyPartMC/actions/runs/12207324656/job/34058852918):

...
 File /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/llvmlite/binding/ffi.py:136, in _lib_wrapper._lib(self)
    132 @property
    133 def _lib(self):
    134     # Not threadsafe.
    135     if not self._lib_handle:
--> 136         self._load_lib()
    137     return self._lib_handle
File /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/llvmlite/binding/ffi.py:130, in _lib_wrapper._load_lib(self)
    124         _ = self._lib_handle.LLVMPY_GetVersionInfo()
    125 except (OSError, AttributeError) as e:
    126     # OSError may be raised if the file cannot be opened, or is not
    127     # a shared library.
    128     # AttributeError is raised if LLVMPY_GetVersionInfo does not
    129     # exist.
--> 130     raise OSError("Could not find/load shared object file") from e
OSError: Could not find/load shared object file

Any hints?
Thanks

@liudonghua123
Copy link

I have the similar problems when install some other package which depend on numba.

Liu.D.H  ~   0ms  11:28 > pip install nexaai --prefer-binary --index-url https://nexaai.github.io/nexa-sdk/whl/cpu --extra-index-url https://pypi.org/simple --no-cache-dir
Looking in indexes: https://nexaai.github.io/nexa-sdk/whl/cpu, https://pypi.org/simple
Collecting nexaai
  Downloading https://github.com/NexaAI/nexa-sdk/releases/download/v0.0.9.7/nexaai-0.0.9.7-cp313-cp313-win_amd64.whl (4.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 5.1 MB/s eta 0:00:00
Collecting cmake (from nexaai)
  Downloading cmake-3.31.2-py3-none-win_amd64.whl.metadata (6.5 kB)
Collecting faster_whisper (from nexaai)
  Downloading faster_whisper-1.1.0-py3-none-any.whl.metadata (16 kB)
Requirement already satisfied: typing-extensions>=4.5.0 in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from nexaai) (4.12.2)
Requirement already satisfied: numpy>=1.20.0 in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from nexaai) (2.1.2)
Collecting diskcache>=5.6.1 (from nexaai)
  Downloading diskcache-5.6.3-py3-none-any.whl.metadata (20 kB)
Requirement already satisfied: jinja2>=2.11.3 in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from nexaai) (3.1.4)
Collecting librosa>=0.8.0 (from nexaai)
  Downloading librosa-0.10.2.post1-py3-none-any.whl.metadata (8.6 kB)
Collecting fastapi (from nexaai)
  Downloading fastapi-0.115.6-py3-none-any.whl.metadata (27 kB)
Collecting uvicorn (from nexaai)
  Downloading uvicorn-0.34.0-py3-none-any.whl.metadata (6.5 kB)
Requirement already satisfied: pydantic in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from nexaai) (2.9.2)
Requirement already satisfied: pillow in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from nexaai) (11.0.0)
Requirement already satisfied: huggingface_hub in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from nexaai) (0.26.0)
Collecting modelscope (from nexaai)
  Downloading modelscope-1.21.0-py3-none-any.whl.metadata (40 kB)
Requirement already satisfied: prompt_toolkit in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from nexaai) (3.0.48)
Requirement already satisfied: tqdm in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from nexaai) (4.66.5)
Collecting tabulate (from nexaai)
  Downloading tabulate-0.9.0-py3-none-any.whl.metadata (34 kB)
Collecting streamlit>=1.37.1 (from nexaai)
  Downloading streamlit-1.41.1-py2.py3-none-any.whl.metadata (8.5 kB)
Collecting streamlit-audiorec (from nexaai)
  Downloading streamlit_audiorec-0.1.3-py3-none-any.whl.metadata (2.4 kB)
Collecting python-multipart (from nexaai)
  Downloading python_multipart-0.0.19-py3-none-any.whl.metadata (1.8 kB)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from jinja2>=2.11.3->nexaai) (3.0.2)
Collecting audioread>=2.1.9 (from librosa>=0.8.0->nexaai)
  Downloading audioread-3.0.1-py3-none-any.whl.metadata (8.4 kB)
Requirement already satisfied: scipy>=1.2.0 in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from librosa>=0.8.0->nexaai) (1.14.1)
Requirement already satisfied: scikit-learn>=0.20.0 in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from librosa>=0.8.0->nexaai) (1.5.2)
Requirement already satisfied: joblib>=0.14 in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from librosa>=0.8.0->nexaai) (1.4.2)
Requirement already satisfied: decorator>=4.3.0 in c:\users\liu.d.h\appdata\local\programs\python\python313\lib\site-packages (from librosa>=0.8.0->nexaai) (5.1.1)
Collecting numba>=0.51.0 (from librosa>=0.8.0->nexaai)
  Downloading numba-0.60.0.tar.gz (2.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.7/2.7 MB 3.7 MB/s eta 0:00:00
  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
  ╰─> [24 lines of output]
      Traceback (most recent call last):
        File "C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\Liu.D.H\AppData\Local\Temp\pip-build-env-s38twml2\overlay\Lib\site-packages\setuptools\build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Liu.D.H\AppData\Local\Temp\pip-build-env-s38twml2\overlay\Lib\site-packages\setuptools\build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "C:\Users\Liu.D.H\AppData\Local\Temp\pip-build-env-s38twml2\overlay\Lib\site-packages\setuptools\build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Liu.D.H\AppData\Local\Temp\pip-build-env-s38twml2\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 51, in <module>
        File "<string>", line 48, in _guard_py_ver
      RuntimeError: Cannot install on Python version 3.13.0; only versions >=3.9,<3.13 are supported.
      [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.

Liu.D.H  ~   1m 2.814s  08:52 >

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

Successfully merging a pull request may close this issue.

10 participants