Numpy无法在Windows命令窗口中加载。 Python版本3.7.1

时间:2019-02-05 20:40:29

标签: python python-3.x windows numpy anaconda

我最近在Windows 10上安装了带有Python 3.7.1的Anaconda3,我也使用Python启动器,因为我的计算机上也安装了Python 2.7。 Python启动器似乎正常工作。

使用Anaconda随附的Spyder IDE时,numpy可以正确导入。但是,从Windows命令窗口中的“启动”版本的Python 3导入时,我得到以下回溯:

c:\>py
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__file__
'C:\\Python27\\lib\\site-packages\\numpy\\__init__.pyc'
>>>

c:\>py -3 --version
Python 3.7.1

c:\>py -3
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
    from . import multiarray
ImportError: DLL load failed: The specified module 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:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import add_newdocs
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\ProgramData\Anaconda3\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 module could not be found.

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

检查这些。 这些可能会对您有所帮助。

WITH CTE AS(
    SELECT UserID,
           StartDate,
           EndDate,
           ROW_NUMBER() OVER (PARTITION BY UserID ORDER BY UsersWordTimeID DESC) AS RN
    FROM usersworktime)
SELECT UserID,
       StartDate,
       EndDate
FROM CTE
WHERE RN = 1;