ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

环境:ArcGIS Pro 2.5.0

配置spyder

  1. 打开ArcGIS Pro , 选择 Settings–Python–Manager Environments , 选择克隆 ,创建conda 虚拟环境,点选clone,完成后,选择新创建的虚拟环境,并确定。
    ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全
    在这里插入图片描述
    ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

  1. 可以选择add Packages ,搜索 spyder , 点击 install ,进行下载。或者打开Anaconda Prompt , **虚拟环境,conda activate 路径\arcgispro,执行conda install spyder,完成spyder 安装。打开spyder ,在ipython 中输入 import arcpy,没有报错。
    ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全
    ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全
    ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全
ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

配置jupyter notebook 及自动代码补全

  1. 打开Anaconda Prompt , **虚拟环境,conda activate 路径\arcgispro,执行 python -m ipykernel install --user --name arcgispro
    ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

  2. 打开jupyter , 选择 new , 即可看到 arcgispro的环境
    ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全
    ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全

  3. 设置jupyter 代码自动补全,需要下载 jupyter_contrib_nbextensions

ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全
关闭 jupyter notebook , 执行 jupyter contrib nbextension install --user --skip-running-check,重启jupyter,选择Nbextensions,勾选 Hinterkand
ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全
ArcGIS Pro python环境配置spyder和jupyter notebook 并添加自动代码补全