I am attempting to do the Python for Everyone training using ArcGIS Pro and python 3.5. I've followed the instructions and installed PyCharm but I am unable to import arcpy so I am unable to run any scripts.
Are there some settings that I need to change in order to use PyCharm?
Solved! Go to Solution.
Which instructions? The Esri instructions for using an IDE with Pro Python or the PyCharm ones? Really, you need to be aware of both.
What exactly is the error message? I use PyCharm regularly with ArcGIS Pro Python, and I haven't had problems importing ArcPy.
I installed PyCharm and did this:
Browse to C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3 and choose python.exe.
Click OK to set the project interpreter.
Click OK to close the Default Settings window.
Note: It may take a moment for the settings
When I try to run the script I get an error when it tries to import arcpy.
I've decided I don't really like developing in Spyder for Py3 stuff.. I went and got PyCharm, have done a bunch of internet sleuthing on how to use it with ArcGIS Pro's installation of Python 3 - sounds really simple, just configure the interpreter to your python.exe buried way down in the Pro folders.. Well I've done that and I can't import arcpy! It doesn't see it as a package.
Anybody? Bueller... Bueller...
ArcPy won't show up in the package list, so that is expected, although I can't remember the exact reason why.
That bottom screenshot, is that your Python console in PyCharm? If so, have you set the Python console to the "correct" Python interpreter because setting the console is different than your project.
If you have set the Python console interpreter to Pro Python, make sure Pro is set to automatically sign in and get a license (if using Named user); otherwise, you will end up getting a RuntimeError when trying to import the module.
Yes I set the project to use ArcPro Py3 as well as the interpreter. Still not importing arcpy, though I do see it in the 'intellisense' list when I type 'import ar...'
It might be the offline licensing issue you mentioned with Pro. It looks like my organization has disabled that, but I can use Spyder and work with ArcPy without being signed into Pro...
The screenshot you posted earlier looks like you are using the console, which has its own setting Python interpreter. You mention that you set the project to use ArcGIS Pro Python, but you didn't state whether the console is using that interpreter as well.