I have a python script that runs in a conda environment that seems incompatible with ArcPy. This python script runs great in my environment when launched from ArcGIS Pro's Python Command Prompt.
However to distribute this tool to others, I am trying to enable launching the python script from a script tool in the GUI. To do so I am using a preliminary script to record the parameters entered into the GUI to a text file and then launch a subprocess that reads a *.bat file that changes the environment to mine and launches the original python script.
The subprocess successfully opens a terminal, changes the environment to mine, however when the original python script runs, it cannot import typical packages like numpy, giving this error:
ValueError: failed to parse CPython sys.version: '3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 05:37:49) [MSC v.1916 64 bit (AMD64)]'
Investigating the environment shows that even though conda shows that I have switched to my environment, it is still trying to import packages from the default ArcGIS Pro environment. I don't understand what is happening, especially considering that there is no problem when running out of the Arc supplied Python Command Prompt (or the windows cmd.exe for that matter).
There seems to be some fundamental difference between the ArcGIS Pro GUI launched prompt and the others, although the only difference I can find lies in this particular behavior.
I was hoping someone might have some suggestions about how to get my python script launched successfully.
Thank you for your time!