Saving a project using python scripting.

578
2
10-19-2023 03:56 AM
AbhyanshuGupta
Emerging Contributor

I am writing a python script in which i am adding a new layer from a feature class using the 'addDataFromPath' function, now i want to save the changes using the project.save() method but its i giving me an OSError. Can anyone please help me how can i resolve this error or any other way around.

I have tried using project.saveACopy() but its not solving my purpose.

Tags (4)
0 Kudos
2 Replies
ASw93
by
Regular Contributor

I believe the .save() method is bugged on versions 2.9 - 3.1. I had this issue today and had to use .saveACopy() instead. 

People reported the issue here:

https://community.esri.com/t5/python-questions/project-service-aprx-object-save-error-from-pro-2/td-...

0 Kudos
AlfredBaldenweck
MVP Regular Contributor

The other thing is that you can use saveACopy() to replace the same file name.

0 Kudos