导入numpy cextensions失败

2024-10-03 00:16:27 发布

您现在位置:Python中文网/ 问答频道 /正文

导入numpy c-extensions失败

我在我的windows系统上安装了python3.7来处理visualstudio代码。一切都很顺利,包括使用图书馆。 我使用控制面板中的卸载程序工具卸载了python。并安装了Miniconda3。 我检查了一下一切正常,然后用conda install numpy在我的终端GitBash上安装了numpy库,然后在visial studio代码中进行了检查,但未能启动。在

复制代码示例:

import numpy as np
A = np.array([[-1], [7], [-26]])

错误消息:

Traceback (most recent call last): File "C:\Users\ramim\Miniconda3\lib\site-packages\numpy\core__init__.py", line 17, in from . import multiarray File "C:\Users\ramim\Miniconda3\lib\site-packages\numpy\core\multiarray.py", line 14, in from . import overrides File "C:\Users\ramim\Miniconda3\lib\site-packages\numpy\core\overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: DLL load failed: Не найден указанный модуль.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:/Users/ramim/Desktop/22/Matrix library/alsf.py", line 3, in import numpy as np File "C:\Users\ramim\Miniconda3\lib\site-packages\numpy__init__.py", line 142, in from . import core File "C:\Users\ramim\Miniconda3\lib\site-packages\numpy\core__init__.py", line 47, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed. - Try uninstalling and reinstalling numpy. - If you have already done that, then: 1. Check that you expected to use Python3.7 from "C:\Users\ramim\Miniconda3\python.exe", and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy version "1.17.3" you're trying to use. 2. If (1) looks fine, you can open a new issue at https://github.com/numpy/numpy/issues. Please include details on: - how you installed Python - how you installed numpy - your operating system - whether or not you have multiple versions of Python installed - if you built from source, your compiler versions and ideally a build log

  • If you're working with a numpy git repository, try git clean -xdf (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on an existing issue about this - open a new one instead.

Original error was: DLL load failed: Не найден указанный модуль.

Numpy/Python版本信息:

在 Python 3.7.5 纽比1.17.3

我试图再次卸载并安装numpy库,但没用。 注意:当我输入条目conda install numpy时,它说:

All requested packages already installed

我就是这样检查numpy是否真的安装了!在

如何解决这个问题?


Tags: infrompycoreimportnumpyyoulib