<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: import error for arcpy.mapping module in jupyter notebook in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/import-error-for-arcpy-mapping-module-in-jupyter/m-p/544590#M42473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. That was helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Mar 2019 14:18:57 GMT</pubDate>
    <dc:creator>ChaudhuriGargi</dc:creator>
    <dc:date>2019-03-28T14:18:57Z</dc:date>
    <item>
      <title>import error for arcpy.mapping module in jupyter notebook</title>
      <link>https://community.esri.com/t5/python-questions/import-error-for-arcpy-mapping-module-in-jupyter/m-p/544588#M42471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have using arcpy with Jupyter notebook for last few months and all the modules work fine except arcpy.mapping.&amp;nbsp;Here is what happening:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I write:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;from arcpy import mapping&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;mxd = arcpy.mapping.MapDocument("R:/CourseData//Exercise1/road.mxd")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;it gives me the following error:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;ImportError&lt;/SPAN&gt; Traceback (most recent call last)
&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;&amp;lt;ipython-input-6-d75a1b04e4b6&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;()&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;      
1&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;----&amp;gt; 2&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;import&lt;/SPAN&gt; mapping&lt;SPAN class="" style="color: #00a250;"&gt;      
3&lt;/SPAN&gt; mxd &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-weight: 400;"&gt;R:/CourseData//Exercise1/&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-weight: 400;"&gt;road&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-weight: 400;"&gt;.mxd&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;ImportError&lt;/SPAN&gt;: cannot import name 'mapping'&lt;/PRE&gt;&lt;P&gt;When I write:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;mxd = arcpy.mapping.MapDocument("R:/CourseData//Exercise1/road.mxd")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;it gives me:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;---------------------------------------------------------------------------
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;AttributeError &lt;/SPAN&gt;Traceback (most recent call last)
&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;&amp;lt;ipython-input-7-099b6ea15d97&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;()&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;      
1&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;----&amp;gt; 2&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt; &lt;/SPAN&gt;mxd &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-weight: 400;"&gt;R:/CourseData//Exercise1/&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-weight: 400;"&gt;road&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-weight: 400;"&gt;.mxd")

&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;AttributeError&lt;/SPAN&gt;: module 'arcpy' has no attribute 'mapping'

&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Any thoughts?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:33:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-error-for-arcpy-mapping-module-in-jupyter/m-p/544588#M42471</guid>
      <dc:creator>ChaudhuriGargi</dc:creator>
      <dc:date>2021-12-11T23:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: import error for arcpy.mapping module in jupyter notebook</title>
      <link>https://community.esri.com/t5/python-questions/import-error-for-arcpy-mapping-module-in-jupyter/m-p/544589#M42472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sounds like you are connecting to the arcpy for ArcGIS Pro (and python 3.x) because 'mapping' is now 'mp'&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/introduction-to-arcpy-mp.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/mapping/introduction-to-arcpy-mp.htm"&gt;Introduction to arcpy.mp—ArcPy | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to edit your references to the old mapping module to replicate what you can in the new mp version&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2019 20:55:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-error-for-arcpy-mapping-module-in-jupyter/m-p/544589#M42472</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-03-27T20:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: import error for arcpy.mapping module in jupyter notebook</title>
      <link>https://community.esri.com/t5/python-questions/import-error-for-arcpy-mapping-module-in-jupyter/m-p/544590#M42473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. That was helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 14:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/import-error-for-arcpy-mapping-module-in-jupyter/m-p/544590#M42473</guid>
      <dc:creator>ChaudhuriGargi</dc:creator>
      <dc:date>2019-03-28T14:18:57Z</dc:date>
    </item>
  </channel>
</rss>

