【发布时间】:2017-11-22 15:56:08
【问题描述】:
我正在尝试使用 pandas python 进行 excel 操作。
每当我尝试使用 pandas 库时,都会出现错误提示未安装 numpy。
现在,当我尝试执行 pip install numpy 和 pip install pandas 时,它显示要求已经满足.
但是当我尝试做一个简单的 numpy 教程时,它在 numpy 的导入语句上出错。
> import numpy as np
>Traceback (most recent call last):
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
> from . import multiarray
>ImportError: DLL load failed: The specified procedure could not be found.
>
>During handling of the above exception, another exception occurred:
>
>Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\__init__.py", line 142, in <module>
> from . import add_newdocs
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
> from numpy.lib import add_newdoc
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
> from .type_check import *
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
> import numpy.core.numeric as _nx
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
> raise ImportError(msg)
>ImportError:
>Importing the multiarray numpy extension module failed. Most
>likely you are trying to import a failed build of numpy.
>If you're working with a numpy git repo, try `git clean -xdf` (removes all
>files not under version control). Otherwise reinstall numpy.
>
>Original error was: ***DLL load failed: The specified procedure could not be found.***
【问题讨论】:
-
看起来你的 NumPy 安装在某种程度上被破坏了。也许使用
pip install --force-reinstall numpy强制重新安装软件包,然后重试。 -
我已经尝试过,但我仍然收到错误消息。当我执行重新安装时,我注意到在安装时它说它正在使用缓存的 numpy 库。我将尝试获取 numpy 轮并手动安装。参考:来自stackoverflow.com/questions/29499815/…的第二个答案
-
这个问题的答案来自这个线程,由恐慌上校回答。 stackoverflow.com/questions/29499815/…