I'm a beginner in Python. I don't believe this is a duplicate question, because the other questions seem to be concerned with starting a conda environment within a command line. I want it to happen on double-click.
I'm writing a script that pulls earthquake information from the USGS's API, plots the coordinates as a point, and appends the data to a pre-existing feature class. It works as a .py on my own machine, both on double-click and when running from the terminal or the python shell. However, the .py version of the script doesn't work on certain computers in our office, presumably because it's using some extra packages that I've got installed or something.
I need it to be able to run easily on double-click on any of our computers without any configuration nonsense on the user's end. To accomplish this, I compiled the script and all of its packages into an .exe with auto-py-to-exe. I already tried both py2exe and pure pyinstaller, and this appears to be the most straightforward converter for my purposes. All of the simple scripts that I have tested with it work perfectly. But when I try to convert my spatial program, I get this error message in the terminal -- presumably because of ArcPy's inclusion:
arcpy must be run from inside the Conda environment, which ArcGIS uses to manage the installation of Python.
You can access this environment by launching Python from the links inside the "ArcGIS > ArcGIS Pro" Start Menu Group:
"Python Interactive Terminal" starts a Python session.
"Python Command Prompt" opens a Command Prompt window initialized with Conda.
Or by running the proenv.bat file in the terminal
C:\> C:\Program Files\ArcGIS\Pro\bin\python\scripts\proenv.bat
Traceback (most recent call last):
File "UpdateEarthquakesDB_final.py", line 5, in <module>
File "PyInstaller\loadr\pyimod03_importers.py", line 540, in exec_module
File "arcpy\__init__.py", line 70, in <module>
ImportError: arcpy needs to run within an active ArcGIS Conda environment
[22316]
Should my goal be to somehow bundle a conda environment with an .exe, to be automatically activated on double-click, or should I go about this some other way?