VS Code终端中的import arcpy失败

时间:2018-05-01 23:32:16

标签: python visual-studio-code arcpy

我试图在vs代码终端中导入arcpy(运行python 2.7作为arcgis安装)。如果我打开命令窗口,启动python并导入arcpy,它运行正常。它也适用于ArcGIS环境。这让我觉得下面的错误是不准确的。导入arcpy在VS Code终端不起作用。我该如何解决这个问题?

>>> import arcpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\__init__.py", line 20, in <module>
    import numpy
File "C:\Python27\ArcGIS10.6\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import add_newdocs
File "C:\Python27\ArcGIS10.6\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
File "C:\Python27\ArcGIS10.6\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
File "C:\Python27\ArcGIS10.6\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
File "C:\Python27\ArcGIS10.6\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 path is invalid.

0 个答案:

没有答案