Skip to main content
added 113 characters in body
Source Link
PhilpM
  • 53
  • 1
  • 6

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.

    The script is hanging but only in one machine and not in another machine.

  • The two machines are VMs and have the same specifications.

    The two machines are VMs and have the same specifications: Windows server 2016, and we connect with RDP

  • The script is hanging only if running through command line but it is not hanging if running through IDE.

    The script is hanging only if running through command line but it is not hanging if running through IDE.

  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.

    The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.

  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")

    The "modified date" property of the MXD file does get updated

  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail

    Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")

  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

    We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail

  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
map_name = "C:/Test_Folder/Test.mxd"
mxd = arcpy.mapping.MapDocument(map_name)
mxd.save()
print("try")
del mxd
print("finally")

The screenshot of the hanging cmd window is the below:

enter image description here

Could anyone suggest any further troubleshooting to explore?

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.
  • The two machines are VMs and have the same specifications.
  • The script is hanging only if running through command line but it is not hanging if running through IDE.
  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.
  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")
  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail
  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
map_name = "C:/Test_Folder/Test.mxd"
mxd = arcpy.mapping.MapDocument(map_name)
mxd.save()
print("try")
del mxd
print("finally")

The screenshot of the hanging cmd window is the below:

enter image description here

Could anyone suggest any further troubleshooting to explore?

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.

  • The two machines are VMs and have the same specifications: Windows server 2016, and we connect with RDP

  • The script is hanging only if running through command line but it is not hanging if running through IDE.

  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.

  • The "modified date" property of the MXD file does get updated

  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")

  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail

  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
map_name = "C:/Test_Folder/Test.mxd"
mxd = arcpy.mapping.MapDocument(map_name)
mxd.save()
print("try")
del mxd
print("finally")

The screenshot of the hanging cmd window is the below:

enter image description here

Could anyone suggest any further troubleshooting to explore?

deleted 99 characters in body
Source Link
PhilpM
  • 53
  • 1
  • 6

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.
  • The two machines are VMs and have the same specifications.
  • The script is hanging only if running through command line but it is not hanging if running through IDE.
  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.
  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")
  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail
  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
map_name = "Test"C:/Test_Folder/Test.mxd"
mxd = arcpy.mapping.MapDocument(map_name)
mxd.save()
print("try")
del mxd
print("finally")

The screenshot of the hanging cmd window is the below:

enter image description hereenter image description here

Could anyone suggest any further troubleshooting to explore?

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.
  • The two machines are VMs and have the same specifications.
  • The script is hanging only if running through command line but it is not hanging if running through IDE.
  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.
  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")
  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail
  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
map_name = "Test.mxd"
mxd = arcpy.mapping.MapDocument(map_name)
mxd.save()
print("try")
del mxd
print("finally")

The screenshot of the hanging cmd window is the below:

enter image description here

Could anyone suggest any further troubleshooting to explore?

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.
  • The two machines are VMs and have the same specifications.
  • The script is hanging only if running through command line but it is not hanging if running through IDE.
  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.
  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")
  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail
  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
map_name = "C:/Test_Folder/Test.mxd"
mxd = arcpy.mapping.MapDocument(map_name)
mxd.save()
print("try")
del mxd
print("finally")

The screenshot of the hanging cmd window is the below:

enter image description here

Could anyone suggest any further troubleshooting to explore?

deleted 173 characters in body
Source Link
PhilpM
  • 53
  • 1
  • 6

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.
  • The two machines are VMs and have the same specifications.
  • The script is hanging only if running through command line but it is not hanging if running through IDE.
  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.
  • Removing try/except/finally still shows the same behavior (i.e., hanging)
  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")
  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail
  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
 
map_name = "Test.mxd"
 
try:
    mxd = arcpy.mapping.MapDocument(map_name)
    mxd.save()
    print("try")
except:
    pass
   del print("except")
finally:mxd
    print("finally")
del mxd

The screenshot of the hanging cmd window is the below:

enter image description here

Could anyone suggest any further troubleshooting to explore?

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.
  • The two machines are VMs and have the same specifications.
  • The script is hanging only if running through command line but it is not hanging if running through IDE.
  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.
  • Removing try/except/finally still shows the same behavior (i.e., hanging)
  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")
  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail
  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
 
map_name = "Test.mxd"
 
try:
    mxd = arcpy.mapping.MapDocument(map_name)
    mxd.save()
    print("try")
except:
    pass
    print("except")
finally:
    print("finally")
del mxd

The screenshot of the hanging cmd window is the below:

enter image description here

Could anyone suggest any further troubleshooting to explore?

When running a simple Python script which is using ArcPy:

  • The script is hanging but only in one machine and not in another machine.
  • The two machines are VMs and have the same specifications.
  • The script is hanging only if running through command line but it is not hanging if running through IDE.
  • The script is not hanging as soon as we remove any action on the mxd object, such as mxd.save() below. I.E., if removing mxd.save() from the script below, it is not hanging anymore.
  • Only Python 2.7 is installed in the machine ("C:\Python27\ArcGIS10.6\python.exe")
  • We tried suggestions in this answer to Python script hanging forever in Pycharm with import arcpy but to no avail
  • We tried to disable AntiVirus, after looking at the ProcMon reports, but to no avail.

The script that is hanging is the below:

import arcpy
map_name = "Test.mxd"
mxd = arcpy.mapping.MapDocument(map_name)
mxd.save()
print("try")
del mxd
print("finally")

The screenshot of the hanging cmd window is the below:

enter image description here

Could anyone suggest any further troubleshooting to explore?

added 77 characters in body
Source Link
PhilpM
  • 53
  • 1
  • 6
Loading
added 87 characters in body
Source Link
PolyGeo
  • 65.5k
  • 29
  • 115
  • 352
Loading
removed thanks
Source Link
Vince
  • 20.5k
  • 16
  • 49
  • 65
Loading
Source Link
PhilpM
  • 53
  • 1
  • 6
Loading