-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: Can't import numpy 2.2.2 on python 3.13.2 #28275
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
Comments
NumPy supports free-threaded Python, we have 313t Windows wheels on pypi. How did you install NumPy? |
I was just typing But this may have been an issue with my environment, i think i and my installed libaries such as opencv-python, were accidently trying to access the thread unlocked version of numpy, with thread-locked version 3.13.2, or maybe the other way around... i got it to work after i installed numpy in the following way through my code editor itsself, which appeared to run the right version of python and installed the right version of numpy: import subprocess
import sys
def install_package(package_name):
try:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', package_name])
except subprocess.CalledProcessError:
print(f"Failed to install {package_name}.")
sys.exit(1)
def main():
install_package('numpy')
import numpy as np
print(f"NumPy version: {np.__version__}")
print(f"Python version: {sys.version}")
if __name__ == '__main__':
main()
|
I think you're running into python/cpython#127294. Closing since this is unrelated to NumPy. |
We recommend using |
Describe the issue:
I require the usage of numpy in combination with opencv-python (any version or the newest one 4.11.0.86). So I was literally just trying to import numpy, on the thread unlocked version of python 3.13.2 (3.13t), but that already makes it error out
Linked: opencv/opencv-python#1029
Reproduce the code example:
Error message:
Python and NumPy Versions:
numpy version 2.2.2
python version 3.13.2 - clicked on experimental version of python with thread unlocked / GIL free in the installer
operating system windows 11 - 64 bit
Runtime Environment:
Was trying to import in Sublime Text 4, which is my main Code Editor
Context for the issue:
It's clearly important that numpy works on all future versions of python!
The text was updated successfully, but these errors were encountered: