-1

I am new to Python and am trying to use PyCharm, mostly to use ArcPy.

I am using ArcGIS Pro 2.5.1, which comes with Python 3.6. I have a server license with my company. I just downloaded PyCharm (community version) and am trying to import arcpy. However, after I type import I do not see arcpy come up as an option. I can run import arcpy, but it doesn't have any effect. There is no module that is actually imported, and I can't seem to access the arcpy tools.

I have my project configured to Python 3.6. When I try to install a package, I do not see any called 'arcpy'. There are other accessory packages to arcpy, such as arcpyext, but they do not allow me to import arcpy.

Thank you.

Jessica Marie
  • 189
  • 1
  • 2
  • 14
  • 1
    Did you check if the PyCharm project is configured to use the same python interpreter in which you isntalled ArcGIS? Perhaps this was installed on a particular virtualenv? – Mateo Torres Nov 20 '20 at 17:41
  • 1
    Did you [install it via Pycharm](https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html)? – Random Davis Nov 20 '20 at 17:48
  • @torresmateo -Yes, I believe so. I configured the project to Python 3.6 from the ArcGIS Pro folder location. – Jessica Marie Nov 20 '20 at 17:51
  • @RandomDavis Apparently I did not install the proper package. I should have installed 'arcpyext'. After that, it worked. If you want to answer I will accept your response as the answer. Thank you. – Jessica Marie Nov 20 '20 at 17:59

1 Answers1

2

Turns out the solution was to install the package arcpyext via Pycharm via their pre-prescribed method: https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

Random Davis
  • 6,662
  • 4
  • 14
  • 24
  • Shoot, I'm so sorry, that actually didn't work like I thought. It only works if Python 2.7 is configured, but I need to use Python 3.6. – Jessica Marie Nov 20 '20 at 19:38
  • If you configure Python 3.6 and then install, what happens? – Random Davis Nov 20 '20 at 19:39
  • I don't think arcpyext is the proper package to install... it is just an extension to arcpy. – Jessica Marie Nov 20 '20 at 19:44
  • So if you install just `arcpy` via that linked method, what happens? Are you certain that that package has a 3.6 or 3.x-compatible version released? – Random Davis Nov 20 '20 at 19:48
  • There is no package called 'arcpy' listed as an available package. However, my version of ArcPro uses Python 3.6, and the command 'import arcpy' is in every example code. [https://pro.arcgis.com/en/pro-app/arcpy/get-started/describing-data.htm] – Jessica Marie Nov 20 '20 at 19:56
  • @JessicaMarie does this help at all? https://community.esri.com/t5/arcgis-api-for-python-questions/how-can-i-get-the-arcpy-module-to-load-in-python-3-6/td-p/717616 – Random Davis Nov 20 '20 at 20:02
  • I read that, and the only solution it seems to offer is to uninstall Python 2.7. I'll follow up with the results. – Jessica Marie Nov 20 '20 at 20:27