Getting the following error message when trying to use arcpy.
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\__init__.py", line 69, in <module>
from arcpy.toolbox import *
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\toolbox.py", line 688, in <module>
from .wmx import ClearJobReplicationInfo as ClearJobReplicationInfo_wmx
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\wmx.py", line 29, in <module>
from arcpy import _wmx
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\_wmx.py", line 9, in <module>
from dateutil import tz
ImportError: cannot import name 'tz'
Solved! Go to Solution.
Working through the error message it appears that not all of the dateutil package modules were loaded into the arcgispro-py3 environment. Once this was done everything worked as expected.
Did you upgrade the computer that you had a previous version of Desktop on? Or is this a new computer with upgraded software? I ask because maybe you had custom python libraries on your old computer that you forgot needed to be installed on your new computer.
No this is a straight update from ArcGIS Pro 1.3 to 1.4. No changes made to the system.
dateutil - powerful extensions to datetime — dateutil 2.6.0 documentation perhaps....
check your conda distribution to see if it is included
The Python Package Manager—ArcPy Get Started | ArcGIS Desktop
There is no assumption that the previous packages would be retained... I woul check
Working through the error message it appears that not all of the dateutil package modules were loaded into the arcgispro-py3 environment. Once this was done everything worked as expected.
Did you need to rerun or fix the install to get these package modules to install correctly?
I just copied the relevant files to the correct location under arcgispro-py3.
OK but where did you get the files to copy? Is the location for these files in 10.3 different than in 10.4, so you copied them from the old 10.3 location?
In my case I copied files from
C:\Program Files\ArcGIS\Pro\bin\Python\envs\.pkgs\python-dateutil-2.6.0-py35_0\Lib\site-packages
to
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages