Skip to content

BUG: Cannot import pandas2.2.3 in free-threading python3.13.0 #60224

Closed
@shinyano

Description

@shinyano

Pandas version checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of pandas.
  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

python3.13t -m venv myenv
myenv\Scripts\activate

(myenv)pip install pandas==2.2.3
(myenv)python
(myenv)>>> import pandas

Issue Description

According to release note, pandas2.2.3 can be used in free-threading python. But when importing pandas(2.2.3) in python3.13t on windows11, python would exit without output or error message:

E:\>python3.13t -m venv myenv
E:\>myenv\Scripts\activate
(myenv) E:\>pip install pandas==2.2.3
Collecting pandas==2.2.3
  Using cached pandas-2.2.3-cp313-cp313t-win_amd64.whl
Collecting numpy>=1.26.0 (from pandas==2.2.3)
  Using cached numpy-2.1.3-cp313-cp313t-win_amd64.whl.metadata (60 kB)
Collecting python-dateutil>=2.8.2 (from pandas==2.2.3)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz>=2020.1 (from pandas==2.2.3)
  Using cached pytz-2024.2-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.7 (from pandas==2.2.3)
  Using cached tzdata-2024.2-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas==2.2.3)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Using cached numpy-2.1.3-cp313-cp313t-win_amd64.whl (12.6 MB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached pytz-2024.2-py2.py3-none-any.whl (508 kB)
Using cached tzdata-2024.2-py2.py3-none-any.whl (346 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pytz, tzdata, six, numpy, python-dateutil, pandas
Successfully installed numpy-2.1.3 pandas-2.2.3 python-dateutil-2.9.0.post0 pytz-2024.2 six-1.16.0 tzdata-2024.2

[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip

(myenv) E:\>python
Python 3.13.0 experimental free-threading build (tags/v3.13.0:60403a5, Oct  7 2024, 09:53:29) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas

(myenv) E:\>

Then I built cpython with debug flag and tried again, the output is as follows:

(debugenv) E:\cpython\cpython-3.13.0\PCbuild\amd64>python
Python 3.13.0 experimental free-threading build (main, Nov  4 2024, 19:14:19) [MSC v.1940 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import pandas
  File "E:\cpython\cpython-3.13.0\PCbuild\amd64\debugenv\Lib\site-packages\pandas\__init__.py", line 49, in <module>
    from pandas.core.api import (
    ...<62 lines>...
    )
  File "E:\cpython\cpython-3.13.0\PCbuild\amd64\debugenv\Lib\site-packages\pandas\core\api.py", line 1, in <module>
    from pandas._libs import (
    ...<4 lines>...
    )
  File "E:\cpython\cpython-3.13.0\PCbuild\amd64\debugenv\Lib\site-packages\pandas\_libs\__init__.py", line 16, in <module>
    import pandas._libs.pandas_parser  # isort: skip # type: ignore[reportUnusedImport]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing pandas_parser: The specified module could not be found.

Expected Behavior

Pandas should be correctly imported.

Installed Versions

I can't use pandas in python3.13t, so it's a little hard to execute pd.show_versions().

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBuildLibrary building on various platformsNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions