Hello, I am having an issue with accessing the arcpy module of my ArcPro's default python environment. I am trying to run a standalone python script that will be initiated by a service account via Task Scheduler. Whenever I use the python 3.7.11 environment to run the script, it fails out when trying to access the arcpy module, saying "Error: The Product License has not been initialized."
I can successfully run the script using an old ArcDesktop python instance (2.7.18.4), though that is not a long term solution since there are other modules that I would like to add to the script in order to increase the script functionality (these modules are not compatible with 2.7.18.4).
The only solution I can think of is trying to have the script authenticate my ArcPro account at the outset of the script, thereby 'unlocking' the 3.7.11 version of arcpy and also allowing me to use the additional modules that I would like.
NOTE: I don't need to post data to AGOL or an Enterprise Portal, so I don't think the ArcGIS API for Python is applicable, but I could be mistaken. I just need to sign into Pro in order to access a python 3 environment.
Does anyone know how this could be accomplished?