如何在Anaconda的Spyder安装中使用arcpy模块

如何在Anaconda的Spyder安装中使用arcpy模块

本文介绍了如何在Anaconda的Spyder安装中使用arcpy模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了Anaconda的Python发行版,其中包括Spyder IDE.我对在Spyder中导入ArcGIS 10.3 arcpy模块感兴趣.不幸的是,运行import arcpy会导致以下错误:

I recently installed Anaconda's Python distribution, which includes Spyder IDE. I am interested in importing the ArcGIS 10.3 arcpy module in Spyder. Unfortunately, running import arcpy results in the following error:

import arcpy
Traceback (most recent call last):

  File "<ipython-input-2-50d283eebbb3>", line 1, in <module>
    import arcpy

  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp

  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *

  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 14, in <module>
    import arcgisscripting

ImportError: No module named arcgisscripting

为解决此错误,我尝试了1)将解释器更改为ArcMap.exe,以及2)移动了Desktop10.1.pth文件,两者均在此SE帖子.解决方案#1使Spyder崩溃,解决方案#2无效.

To resolve this error, I have tried 1) changing the interpreter to ArcMap.exe and 2) moving the Desktop10.1.pth file, both as shown in this SE post. Solution #1 crashes Spyder and solution #2 has no effect.

要导入和使用Spyder的Anaconda发行版中的arcpy模块,需要执行哪些步骤?

What steps are needed to be able to import and use the arcpy module in the Anaconda distribution of Spyder?

推荐答案

有关如何执行此操作的很好的解释

A good explanation on how to do this here

我强烈建议您阅读该帖子.

I strongly recommend reading that post.

这篇关于如何在Anaconda的Spyder安装中使用arcpy模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 12:10