I've issue license initialization in ArcGIS Pro 2.7. I can run python script manually via command line and batch file but encountered with following run time error with scheduled task in Windows server 2019.
File "C:\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 14, in <module>
import arcgisscripting
File "C:\arcgis\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgisscripting\__init__.py", line 128, in <module>
from ._arcgisscripting import *
RuntimeError: The Product License has not been initialized.
Any ideas or solutions?
Thanks in advance,
Chintamani
Solved! Go to Solution.
I had an issue with the company Firewall rules 😞
Cristian,
Can you provide more details on what Firewall rules?
I am having the same problem, and I suspect that the Firewall might be the issue, but not sure how to figure it out.
Thank you!
Hallo Darina,
To be hones the error was solved by the IT guy that manage the corporate Firewall. I can tell you that a rule was created to allow communication with www.arcgis.com.
You can check a detailed document for your whitelist here: https://downloads.esri.com/resources/enterprisegis/AGOL_Domain_Requirements.pdf
Thank you, Cristian!
We whitelisted some of these a few months ago when AGOL updated and most of our python scripts stopped working. We had to add some amazon ones to the list too.
But I will ask our Network guys to add the ones we haven't. Hope that resolves the issue because I don't think logging in as the account running the process and running ArcGIS Pro is a solution for us.
Yes, it wastes my time, as I have to go through this every time the machine is restarted and some other times when it just stops working for no reason that I can detect. I hope to find a better solution.
Thank you to everyone who replied. I got it working. For the purposes of this description, I will say the user that runs the process is "batch_runner". Here's what I did:
1) Log in to the server machine as batch_runner. (This was a bottleneck for a while, but had nothing to do with ArcGIS) and download a single user license file executable.
2) Run the single user license file and when prompted, oog in to ArcGIS Pro as a named user with my own account credentials.
3) Switch ArcGIS Pro to a single user license (in that log in session)
a) Select "Configure your licensing options".
b) Change the License Type to "Single Use License".
c) Click Authorize and follow the steps in the Software Authorization Wizard. Click Ok.
d) Restart ArcGIS Pro.
4) Et voila! It worked. 🙂
I believe this created a profile under batch_runner, because after this, it could run the arcpy processes.
I am still trying to find out what I'll need to renew the license which will expire in July. But at least it's working for the moment. Thank you for all the responses and helpful information!
I have a concurrent licence and this was the "simple" solution that worked for me, informed by everyone's responses above:
1) login to ArcPro with my MyESRI credentials, which are linked to my organisation.
2) Borrow licence, that is check "Authorize ArcGIS Pro to work offline"
Viola, simple as that, no more error... until licence expired and I then just re-borrowed 🙂
I find the following helpful:
Overall, running scripts against Pro conda is about half as stable as python 2.7 unless you get the recipe nailed. This has always been an issue with Pro and I am sure ESRI would rather sell us Notebook Server advanced which is very cool but $$$$$.
I'm also having some trouble with this exact issue. I can run python scripts just fine, but not automate them with system scheduler. Currently we operate mostly out of Enterprise (ie. no spare licenses in AGOL) using a license manager with concurrent licenses. However, this was a recent change - the user I'm attempting to run the scripts with does have a roaming Pro file. I've tried to set the license to approve for offline use, but nothing doing. Anyone with a similar setup have success?
Hello everyone,
I had the same error message in our development server, and for me the solution was simple. I just opened ArcGIS Pro on the server and it behaved like I was opening it for the first time, it asked to connect to AGOL to validate the license. Then I tested again the script and the line "import arcpy" did not return any error message.
Thanks