r/learnpython • u/cjmejias17 • 1d ago
I can't impor numpy -Windows 10
Hola a todos, necesito ayuda
Estamos aprendiendo python, instalamos la version 3.14, instalamos en una laptop con window 11 y todo funciona bien.
384
Hi everyone, I need help.
We're learning Python. We installed version 3.14 on a Windows 11 laptop, and everything works fine. However, the installation on Windows 10 doesn't work when I try to import NumPy.
The `testnumpy.py` module has the following instructions: `import numpy`
`print('hello word')`
When I run `python testnumpy.py`, I get the following error:
Traceback (most recent call last):
File "C:\KAIROS\Python\Python314\Lib\site-packages\numpy_core__init__.py", line 24, in <module>
from . import multiarray
File "C:\KAIROS\Python\Python314\Lib\site-packages\numpy_core\multiarray.py", line 11, in <module>
from . import _multiarray_umath, overrides
ImportError: DLL load failed while importing _multiarray_umath: Error en una rutina de inicialización de biblioteca de vínculos dinámicos (DLL).
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\KAIROS\testnumpy.py", line 1, in <module>
import numpy
File "C:\KAIROS\Python\Python314\Lib\site-packages\numpy__init__.py", line 122, in <module>
from numpy.__config__ import show_config
File "C:\KAIROS\Python\Python314\Lib\site-packages\numpy__config__.py", line 4, in <module>
from numpy._core._multiarray_umath import (
...<3 lines>...
)
File "C:\KAIROS\Python\Python314\Lib\site-packages\numpy_core__init__.py", line 85, in <module>
raise ImportError(msg) from exc
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python 3.14 from "C:\KAIROS\Python\Python314\python.exe"
* The NumPy version is: "2.5.2"
and make sure that they are the versions you expect.
Please carefully study the information and documentation linked above.
This is unlikely to be a NumPy issue but will be caused by a bad install
or environment on your machine.
Original error was: DLL load failed while importing _multiarray_umath: Error en una rutina de inicialización de biblioteca de vínculos dinámicos (DLL).
Any suggestions?
1
1
u/FoolsSeldom 20h ago
- How did you install
numpy? - Did you install it into the same Python virtual environment as is being used when you run your code (from an editor such as VS Code)?
On Windows, I'd expect you to have done something like, in Powershell:
mkdir myprojects
cd myproject
mkdir thisproject
cd thisproject
py -m venv .venv
.venv\Scripts\activate
pip install numpy
In your editor, you will need to ensure that the Python interpreter being used is the one in:
c:\Users\yourusername\myprojects\thisproject\.venv\Scripts\python.exe
Some editors have a package management tool built-in where you can install packages. Also, if there's a terminal option, when opened the Python virtual environment may have been activated already.
1
u/danielroseman 1d ago
Did you look at the link in the error message? Did any of those tips help?
The message also says that it might be something to do with how numpy was installed. So how did you install numpy?