arcpy.usage giving error 999999

791
1
06-04-2020 01:11 AM
MartinPackford
New Contributor

When I try to run any arcpy.usage(...) in the pycharm console it comes back with the following:

Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-be77ac717221>", line 1, in <module>
arcpy.Usage("JoinField_management")
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 866, in Usage
return gp.usage(tool_name)
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 313, in usage
self._gp.Usage(*gp_fixargs(args, True)))
RuntimeError: ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.

I have set the interpreter to:

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe

and I have imported arcpy.

Anyone know if I'm missing something?

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

It may be what is needed to run and initialize pycharm.  For instance, when using Spyder, an initializing script is created when it is installed and used (see below).  Check your folder structure to see if there is some *.py script with pycharm's name in it.

arcpy.Usage does work in Spyder and ArcGIS Pro's notebooks

C:\Install_folder\bin\Python\envs\arcgispro-py3\pythonw.exe "C:\Install_folder\bin\Python\envs\arcgispro-py3\Scripts\spyder-script.py"


... sort of retired...
0 Kudos