I am coding in a Python IDE (integrated development environment), not in Pro. When I do import arcpy, I can then work with most everything I need. 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:
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".
I get basically the same error if I try this:
from arcpy.da import Describe
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.
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:
C:\Users\<user>\AppData\Local\ESRI\conda\envs\<env>\Lib\site-packages\arcgisscripting\_arcgisscripting.pyd
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.
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.