I'm trying out pandas in free-threading python. According to pandas document, pandas==2.2.3 can be used in python3.13.
I installed python3.13 on Windows11 and created virtual environment.
python3.13t -m venv myenv
myenv\Scripts\activate
Then, in the venv I installed and imported pandas==2.2.3, but python exited without any output.
(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:\>
How could I correctly import pandas in python3.13t?
I tried again with cpython built with debug flag. Here is a more detailed error log:
(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.
I didn't really find useful information about this error.
SOLVED.
Although pandas document says it has been compatible with Python 3.13 free-threading build, it actually didn't provide coresponding wheel file for windows yet.
The error here was because that pip tried to build wheel file for python3.13t from source code, and generated a wrong wheel file.
However, in this PR you can find the right wheel file cp313t-win_arm64
. You can download it from Artifacts
and use python3.13t -m pip install pandas*.whl
to install it in python3.13t.