【问题标题】:Numpy ImportError using Sublime Text with Anaconda将 Sublime Text 与 Anaconda 一起使用的 Numpy ImportError
【发布时间】:2019-05-07 11:23:30
【问题描述】:

ImportError 尝试使用 Anaconda Distribution 在 Sublime Text3 中导入 numpy

我正在尝试使用 Anaconda Distribution 在 Sublime Text3 中导入 Numpy。我已经将我的构建系统设置为 Anaconda 的路径,并且 Numpy 在所有 anaconda 的 IDE 包中运行良好。

Sublime 构建系统:

{
"path":"C:\\Users\\my_user\\AppData\\Local\\Continuum\\anaconda3\\",
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",

"variants":
[
    {
        "name": "Syntax Check",
        "shell_cmd": "python -m py_compile \"${file}\"",
    }
]
}
import numpy as np

ImportError: DLL load failed: The specified module can not be found.

I expect to import the module correctly, but shows the error:

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: No se puede encontrar el m�dulo especificado.

【问题讨论】:

    标签: python-3.x numpy anaconda importerror


    【解决方案1】:

    我在运行conda Sublime Text 包的 Windows 10、SublimeText 3 64 位和 Anaconda3 64 位上遇到了同样的问题。这是一个解决方法:

    您可以尝试在工作 python 环境 (env) 中重新安装 numpy python 包。例如,如果您正在使用 mypython 环境,请打开 Anaconda 命令提示符并执行以下操作:

    conda activate mypython

    然后使用pip重新安装numpy

    pip install --upgrade --force-reinstall numpy

    然后在 Sublime Text 中再试一次,应该没问题。

    【讨论】:

      【解决方案2】:

      我遇到了完全相同的问题,我尝试了所有方法。

      • 不同的构建系统代码。
      • 修改系统路径。
      • 从 python.org 安装 python
      • 重新安装 sublime text。
      • 甚至从奇怪的来源下载 DLL 文件。

      最后只重新安装 anaconda 并重新编写系统路径解决了我的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-07-29
        • 1970-01-01
        • 2013-08-31
        • 2016-07-01
        • 2021-02-05
        • 2018-11-22
        • 2017-07-10
        • 2018-10-28
        相关资源
        最近更新 更多