AnsweredAssumed Answered

import error for arcpy.mapping module in jupyter notebook

Question asked by gchaudhuri@uwlax.edu_UWL on Mar 27, 2019
Latest reply on Mar 28, 2019 by gchaudhuri@uwlax.edu_UWL

I have using arcpy with Jupyter notebook for last few months and all the modules work fine except arcpy.mapping. Here is what happening:

 

When I write:

import arcpy
from arcpy import mapping
mxd = arcpy.mapping.MapDocument("R:/CourseData//Exercise1/road.mxd")

 

it gives me the following error:

---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-6-d75a1b04e4b6> in <module>()     
1
import arcpy
----> 2 from arcpy import mapping     
3
mxd = arcpy.mapping.MapDocument("R:/CourseData//Exercise1/road.mxd")
ImportError: cannot import name 'mapping'

When I write:

import arcpy
mxd = arcpy.mapping.MapDocument("R:/CourseData//Exercise1/road.mxd")

 

it gives me:

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-7-099b6ea15d97> in <module>()     
1
import arcpy
----> 2 mxd = arcpy.mapping.MapDocument("R:/CourseData//Exercise1/road.mxd")

AttributeError: module 'arcpy' has no attribute 'mapping'

Any thoughts?

Outcomes