Skip to content

Pandas cannot import numpy in free-threaded version of 3.13.0b2 #120653

@kdgts

Description

@kdgts

Bug report

Bug description:

  1. Install python 3.13.0b2 on windows 10, make sure to install free-threaded binaries
  2. Go to the python installation directory and install pandas by running:
    python -m pip install pandas
    This will also install numpy
  3. Create file KDTest.py someplace outside of python installation directory with the following content:
from pandas import Timestamp

if __name__ == '__main__':
    t1: Timestamp = Timestamp("2023-11-29")
    print("Done")
  1. Assuming python is installed to C:\apps\python313 run
    C:\apps\python313\python.exe <path to file>/KDTest.py
    Result: all good, Done is printed
  2. Now run:
    C:\apps\python313\python3.13t.exe <path to file>/KDTest.py
    Result:
Traceback (most recent call last):
  File "<path to file>\KDTest.py", line 1, in <module>
    from pandas import Timestamp
  File "C:\apps\python313\Lib\site-packages\pandas\__init__.py", line 19, in <module>
    raise ImportError(
        "Unable to import required dependencies:\n" + "\n".join(_missing_dependencies)
    )
ImportError: Unable to import required dependencies:
numpy: Error importing numpy: you should not try to import numpy from
        its source directory; please exit the numpy source tree, and relaunch
        your python interpreter from there.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions