Comments
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. |
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: