<?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: error importing arcpy.da package into my Python IDE in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134844#M63533</link>
    <description>&lt;P&gt;FWIW, I tried it in VS Code and got the same result as PyDev.&lt;/P&gt;&lt;P&gt;Idle (delivered with ArcGIS) doesn't give me any code hints for anything ever. Maybe I'm not using it right, but it seems like a very basic text editor that has some Python integration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think VS Code, PyDev, and Idle are the only IDEs allowed in my environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jan 2022 00:22:44 GMT</pubDate>
    <dc:creator>davedoesgis</dc:creator>
    <dc:date>2022-01-19T00:22:44Z</dc:date>
    <item>
      <title>error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133175#M63494</link>
      <description>&lt;P&gt;I am coding in a Python IDE (integrated development environment), not in Pro. When I do &lt;FONT face="courier new,courier" color="#993300"&gt;import arcpy&lt;/FONT&gt;, I can then work with most everything I need.&amp;nbsp; For example, as I write my code, I get code hints telling me about objects, functions, and properties, as you can see in this screenshot:&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_0-1642029951174.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31340i60A93E5924D4F1F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="dcafdg_0-1642029951174.png" alt="dcafdg_0-1642029951174.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, if I try to work with anything in the arcpy.da package, I don't get code hints, and also get errors in the IDE's editor. Hovering my mouse over the error, it says "Undefined variable from import: Describe".&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_2-1642030334567.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31345iA895D206192F002D/image-size/large?v=v2&amp;amp;px=999" role="button" title="dcafdg_2-1642030334567.png" alt="dcafdg_2-1642030334567.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I get basically the same error if I try this:&amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#993300"&gt;from arcpy.da import Describe&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Just to be clear, my code executes just fine. The issue is that my IDE doesn't give me any hints on coding this and it decorates that line with an error. Of course, looking for errors is an important part of coding, so this is super annoying.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see this trying to use external source code, for example. I resolve that by adding the packages to my PythonPath. But when I look at the source in arcpy.da, it is iterating over all the modules from arcgisscripting.da and adding them . As far as I can tell, all of arcpy.da is in a .pyd file here:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;C:\Users\&lt;EM&gt;&amp;lt;user&amp;gt;&lt;/EM&gt;\AppData\Local\ESRI\conda\envs\&lt;EM&gt;&amp;lt;env&amp;gt;&lt;/EM&gt;\Lib\site-packages\arcgisscripting\&lt;STRONG&gt;&lt;FONT color="#993300"&gt;_arcgisscripting.pyd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;My (very limited) understanding is .pyd files are DLLs that are loaded at run time. This makes sense that my IDE doesn't know what to do with it in advance, but it runs just fine. Any advice on how to add modules from a pyd file to the PythonPath is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;FWIW: My IDE is PyDev in Eclipse. I mention this last, since it seems like a general problem and don't want to get dragged into the specifics of PyDev.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 00:25:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133175#M63494</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-01-13T00:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133192#M63497</link>
      <description>&lt;P&gt;Note - Once I get the program running and stop it at a breakpoint, now I can work with everything just fine. This also fits with the idea of it not loading the modules until run-time.&amp;nbsp;In this case, I imported arcpy and started to type the name of a function in the arcpy.da package and it came up with code hints.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_0-1642034773783.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31362i4B63550D726032F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="dcafdg_0-1642034773783.png" alt="dcafdg_0-1642034773783.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 00:49:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133192#M63497</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-01-13T00:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133247#M63498</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="describe.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31381i961830EABB7A1FDE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="describe.png" alt="describe.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="describe1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31382i960D2D793A9EF6F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="describe1.png" alt="describe1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;works fine in Spyder, I just have my tips/help directed to a separate window, rather than cluttering up my visual space as I type... but the info is there&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 02:50:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133247#M63498</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-13T02:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133255#M63499</link>
      <description>&lt;P&gt;Thanks. Unfortunately, Spyder is not approved at my work... There clearly is some way to follow the thread of run-time imports, and PyDev is not following it. It can import raw source, egg, wheel, dll, and .pyd files, but I have to tell it where to find that object, and so far have not located it...&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 05:58:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133255#M63499</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-01-13T05:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133326#M63500</link>
      <description>&lt;P&gt;you could always do what the esri code does and import it directly.&amp;nbsp; I usually use&lt;/P&gt;&lt;P&gt;import arcgisscripting as ags&lt;/P&gt;&lt;P&gt;since it is in the site-packages folder of your install&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 12:50:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1133326#M63500</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-13T12:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134657#M63528</link>
      <description>&lt;P&gt;That has the same result. I think that's the problem is the whole arcgisscripting package loads from a DLL (as a .pyd file) at runtime and not as source code. The import produces an error in my IDE, but will execute.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_0-1642524866009.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31715i1D07776851AD0F2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="dcafdg_0-1642524866009.png" alt="dcafdg_0-1642524866009.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My IDE can add DLL and PYD files to my PythonPath, but I have to locate it in order to do so. I have traced through the Esri source code about as far as I'm able to. It ends up calling function&amp;nbsp;convertArcObjectToPythonObject in C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcobjects\arcobjectsconversion.py and that's where I lose the trail.&lt;/P&gt;&lt;P&gt;Clearly, there is something slightly less persistent in my IDE's imports, but looking at Esri's code, well, it's sharks with lasers...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 17:10:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134657#M63528</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-01-18T17:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134660#M63529</link>
      <description>&lt;P&gt;Things that are IDE specific are out of the realm of the things that can be addressed.&amp;nbsp; Perhaps bringing this up with them&lt;/P&gt;&lt;P&gt;Is this the github site?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://github.com/fabioz/Pydev" target="_blank"&gt;fabioz/Pydev: Python IDE for Eclipse (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.pydev.org/developers.html" target="_blank"&gt;Developers (pydev.org)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 17:15:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134660#M63529</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-18T17:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134787#M63531</link>
      <description>&lt;P&gt;Yes, that's it. I think this issue is at the intersection of Esri saying "your IDE could do this better" and my IDE's support asking "why is this package importing other packages that go 17 levels deep in the traceback with all of this redirection and over-complicated introspection and dynamic importing, plus reading run-time-only DLLs that import other run-time-only DLLs?"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 21:02:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134787#M63531</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-01-18T21:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134810#M63532</link>
      <description>&lt;P&gt;Seem like a case of proprietary software&amp;nbsp; trying to preserve their investments.&amp;nbsp; The rabbit hole is fraught with obstacles&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 22:20:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134810#M63532</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-18T22:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: error importing arcpy.da package into my Python IDE</title>
      <link>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134844#M63533</link>
      <description>&lt;P&gt;FWIW, I tried it in VS Code and got the same result as PyDev.&lt;/P&gt;&lt;P&gt;Idle (delivered with ArcGIS) doesn't give me any code hints for anything ever. Maybe I'm not using it right, but it seems like a very basic text editor that has some Python integration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think VS Code, PyDev, and Idle are the only IDEs allowed in my environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 00:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-importing-arcpy-da-package-into-my-python/m-p/1134844#M63533</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-01-19T00:22:44Z</dc:date>
    </item>
  </channel>
</rss>

