My python scripts that call ArcGIS.gis and pandas module work fine in jupyter notebook. But failed when running as a standalone py file. I used the same commands (see below) to setup the environment before launching jupyter notebook or the py file. Anything I missed for running the py file standalone?
set PATH=C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3;C:\Program Files\ArcGIS\Pro\bin\Python\Scripts;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts;%PATH%
set PYTHONPATH=C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages;%PYTHONPATH%
From what I see above you are looking to access the api from the python environment installed with pro.
Take a look at the following help topic, it will outline the different ways you can access and run a stand alone script from that environment:
Let me know if you have any questions.
Ok, don't know why, but if I replace my python script call in the bat file
"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" BHP_AGOL_API_module_tests.py
Then everything works fine, both arcgis.gis and pandas.
Allen, it is just easier to create desktop shortcuts to your python IDE (example uses spyder), Jupyter Notebook and IPython and the proenv.bat file.... see this for examples
and one specifically for Jupyter