Closed
Description
Bug report
Bug description:
- Install python 3.13.0b2 on windows 10, make sure to install free-threaded binaries
- Go to the python installation directory and install pandas by running:
python -m pip install pandas
This will also install numpy - 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")
- 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 - 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
Activity
JamesParrott commentedon Jun 17, 2024
This issue should be closed, and reopened in the Numpy and Pandas repos.
The latest release of Numpy, version 2.0.0, came out only yesterday. It does not support Python 3.13.
Nonetheless, Numpy support for Python 3.13 is actively being worked on: numpy/numpy#26157
@kdgts
There are only bdists on PyPi for Python 3.12 for both Pandas and Numpy,
https://pypi.org/project/pandas/#files
https://pypi.org/project/numpy/#files
Pip will have attempted to build them both, and quite likely silently failed (unless all of the following build dependencies were installed: https://numpy.org/doc/stable/building/index.html).
colesbury commentedon Jun 17, 2024
I think there may be an underlying issue in CPython here where the packages are shared between the free-threaded and default builds in ways that lead to confusing error messages.
@kdgts wrote:
But this is installing pandas and numpy packages for the default build (not free-threaded)
You'd want to install them by
python3.13t.exe -m pip install pandas
ngoldbaum commentedon Jun 17, 2024
kdgts commentedon Jun 17, 2024
Well, given that everything works just fine with python13 regular but fails with python13 free-threaded it's pretty obvious that issue is not with numpy or pandas but rather with free-threaded python
JamesParrott commentedon Jun 17, 2024
My apologies - it was taking so much longer than normal to install pandas, I assumed pip had hung. But it completed eventually.
I have reproduced the behaviour (after installing pandas into a venv first), and it is the same error as in your post, pretty much verbatim. Moreover, on simply importing numpy:
lesteve commentedon Jun 19, 2024
rgommers commentedon Jun 19, 2024
Not yet, Windows is still in the works. Python 3.13.0b2 was the first version that included free-threaded support in Python itself; there is an issue with it in
pyconfig.h
that needs working around before NumPy can be built. I'm working on that right now actually - it'll be a few weeks at least before the fixes to the build system fixes propagate and Pandas & co can be built as well.rgommers commentedon May 16, 2025
This issue was fixed a long time ago, can someone hit the close button please?
I'll note that NumPy has had cp313t wheels for Windows on PyPI for several releases; Pandas hasn't seen a release in a long time and 2.2.3 didn't have Windows wheels; a Pandas nightly wheel can be installed from https://anaconda.org/scientific-python-nightly-wheels/pandas though.