Select to view content in your preferred language

I upgraded to ArcGIS Pro 1.4 and I get an error when trying to import arcpy.

3049
8
Jump to solution
01-20-2017 10:42 AM
PhilipWoods1
Occasional Contributor

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'

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
PhilipWoods1
Occasional Contributor

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.

View solution in original post

0 Kudos
8 Replies
MichaelVolz
Esteemed Contributor

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.

0 Kudos
PhilipWoods1
Occasional Contributor

No this is a straight update from ArcGIS Pro 1.3 to 1.4. No changes made to the system.

0 Kudos
DanPatterson_Retired
MVP Emeritus

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

0 Kudos
PhilipWoods1
Occasional Contributor

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.

0 Kudos
MichaelVolz
Esteemed Contributor

Did you need to rerun or fix the install to get these package modules to install correctly?

0 Kudos
PhilipWoods1
Occasional Contributor

I just copied the relevant files to the correct location under arcgispro-py3.

0 Kudos
MichaelVolz
Esteemed Contributor

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?

0 Kudos
PhilipWoods1
Occasional Contributor

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

0 Kudos