<?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: Arcpy fails to import in Spyder in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479460#M37492</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Happened to me, once or twice... waiting and/or rebooting fixed the issue:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; datetime

&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geoprocessing &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; gp

dir&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;gp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'__class__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__delattr__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__dict__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You will have to follow the long and circuitous path in your installation path to arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Your_path_to_arcgis_pro\Resources\ArcPy\arcpy&amp;nbsp;&lt;/STRONG&gt; which contains &lt;STRONG&gt;Bin, Resources and Support&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the __init__.py files starts the imports, which imports stuff... including _base.py amongst others.&lt;/P&gt;&lt;P&gt;You can follow the trail which generally leads to a dead end (ie *.pyd files usually) and try to figure out why any connection would be needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short... you probably shouldn't know or want to know.&amp;nbsp; I have explored some of this &lt;A href="https://community.esri.com/blogs/dan_patterson/2018/09/26/import-arcpy-what-happens" target="_blank"&gt;/blogs/dan_patterson/2018/09/26/import-arcpy-what-happens&lt;/A&gt; to check namespace, load time and bloat issues when just importing arcpy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:09:56 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T21:09:56Z</dc:date>
    <item>
      <title>Arcpy fails to import in Spyder</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479459#M37491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Today I'm working in Spyder just like any other day but when I try to import arcpy, I get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; datetime

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

&amp;nbsp; File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-3-5467a3dc9fe3&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&amp;nbsp; File &lt;SPAN class="string token"&gt;"C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;72&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geoprocessing &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; gp

&amp;nbsp; File &lt;SPAN class="string token"&gt;"C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\__init__.py"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;14&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_base &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;

&amp;nbsp; File &lt;SPAN class="string token"&gt;"C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;14&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcgisscripting

RuntimeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Not signed into Portal&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I imported datetime &amp;amp; os just to see if they worked okay and they do;&amp;nbsp; I get this error if I let the console window sit long enough. I'm curious what the connection is with arcpy, spyder, python and Portal/ArcGIS Online is and how I can avoid this in the future....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eta moments later....&amp;nbsp; Shut down spyder and reopened it: cured.... (?)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:09:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479459#M37491</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T21:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy fails to import in Spyder</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479460#M37492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Happened to me, once or twice... waiting and/or rebooting fixed the issue:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; datetime

&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geoprocessing &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; gp

dir&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;gp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'__class__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__delattr__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__dict__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You will have to follow the long and circuitous path in your installation path to arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Your_path_to_arcgis_pro\Resources\ArcPy\arcpy&amp;nbsp;&lt;/STRONG&gt; which contains &lt;STRONG&gt;Bin, Resources and Support&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the __init__.py files starts the imports, which imports stuff... including _base.py amongst others.&lt;/P&gt;&lt;P&gt;You can follow the trail which generally leads to a dead end (ie *.pyd files usually) and try to figure out why any connection would be needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short... you probably shouldn't know or want to know.&amp;nbsp; I have explored some of this &lt;A href="https://community.esri.com/blogs/dan_patterson/2018/09/26/import-arcpy-what-happens" target="_blank"&gt;/blogs/dan_patterson/2018/09/26/import-arcpy-what-happens&lt;/A&gt; to check namespace, load time and bloat issues when just importing arcpy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:09:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479460#M37492</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T21:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy fails to import in Spyder</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479461#M37493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;resolved?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2018 23:55:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479461#M37493</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-25T23:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy fails to import in Spyder</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479462#M37494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Restart.&amp;nbsp; (note my edit moments later...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/425432_giphy.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 11:59:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479462#M37494</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-10-26T11:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy fails to import in Spyder</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479463#M37495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 12:09:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-fails-to-import-in-spyder/m-p/479463#M37495</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-26T12:09:53Z</dc:date>
    </item>
  </channel>
</rss>

