Import arcpy problems with migrating from 10.0 to 10.1

762
7
05-08-2014 06:23 PM
GlennKammerer
New Contributor II
Windows 7 Pro SP2 32 bit
ArcGIS Basic (ArcView) 10.1

So I finally moved away from 10.0 to 10.1. I seem to be having some problems with my Python scripts. None of them work, and I think it may be a Python version issue and Import arcpy isn't happening. Below is the error message I get every time I try running one of my tools:

[ATTACH=CONFIG]33695[/ATTACH]

Anybody have any idea on where to even start on something like this?
Tags (2)
0 Kudos
7 Replies
KevinHibma
Esri Regular Contributor
Based on your screen shot - I see both Python2.6 and Python2.7 paths trying to be called.
I'm not certain how this has happened.

Did you manually install Python 2.6 (when you were using it with 10.0)?
Could you uninstall it to see if that fixes it?

If you go here:
C:\Python26\ArcGIS10.2\Lib\site-packages  //  C:\Python27\ArcGIS10.1\Lib\site-packages
....do you see a "desktop10.0.pth" or "destop10.1.pth" in either directory?
Since you only have DT 10.1 installed, you should only have desktop10.1.pth in the Python27\ArcGIS10.1\Lib\site-packages folder.
0 Kudos
GlennKammerer
New Contributor II
2.6 was installed when ArcMap 10.0 was installed. In the Python26 directory, there is no site-packages folder in the lib folder. Looks like the 2.6 directory is somewhat gutted. The Python27 directory does have the "desktop10.1.pth" file that you mentioned below.

Prior to installing 10.1, I uninstalled the Data Interoperability for 10.0 and then 10.0 itself using Windows. Was that a bad idea?

I considered uninstalling Python26, but...I don't see it in the Program list in Control Panel.



Based on your screen shot - I see both Python2.6 and Python2.7 paths trying to be called.
I'm not certain how this has happened.

Did you manually install Python 2.6 (when you were using it with 10.0)?
Could you uninstall it to see if that fixes it?

If you go here:
C:\Python26\ArcGIS10.2\Lib\site-packages  //  C:\Python27\ArcGIS10.1\Lib\site-packages
....do you see a "desktop10.0.pth" or "destop10.1.pth" in either directory?
Since you only have DT 10.1 installed, you should only have desktop10.1.pth in the Python27\ArcGIS10.1\Lib\site-packages folder.
0 Kudos
IanMurray
Frequent Contributor
I believe when you install a more recent version of ArcGIS it automatically uninstalls the older version as it installs the newer version.  So yes it was probably not the best idea to manually uninstall 10.0 prior to installing 10.1.  What the effect of this would be I wouldn't know though.
0 Kudos
KevinHibma
Esri Regular Contributor
If you let Arc install Python for 10.0, then used the uninstaller for Data Interop, then uninstaller for ArcMap - everything should have been left in a good state.
Its possible you're still seeing stuff in the Python 2.6 directories because you installed 3rd party modules after the fact (Arc wont clean those up).
If you did your own Python install for 10.0, Arc uninstaller wont remove it. Because you dont have the option to uninstall, again it sounds like you let Arc install it and the core pieces of it went away when you removed 10.0

If I were to tell you to go and delete directories without understanding your system completely it would be irresponsible of me. I'd suggest contacting Support and they you can help you "clean up" and most likely do a "re-install".

Thinking more about this though - within the Python window, can you do an "import arcpy"? If you can do that, it might not be as bad as it seems. It could be something specifically in your script (like a dependency on a 3rd party module) which you haven't yet  installed for your Python 2.7 deployment. The error you posted might be cryptically saying that.
0 Kudos
IanMurray
Frequent Contributor
I was thinking the same thing Kevin.  From the error code it looks like it was having an issue with the fnmatch module, which it was trying to get from the python26 folder.
0 Kudos
GlennKammerer
New Contributor II
<facepalms>

My sincerest apologies.

I've doing GIS for 14 years. Maybe not at the highest levels, but high enough and long enough to know that REBOOTING YOUR SYSTEM AFTER A MAJOR INSTALL is a good idea.

Which I didn't do. Until now.

And...um...things seem to working just fine. The script(s) that were generating the error I posted in the original post, are working just fine. My developer co-worker said that the system path variable wasn't going to reflect any changes until after a reboot, which was likely the cause for the failures.

Then he laughed at me. Deservedly so.

So...step away, folks, nothing to see here.
0 Kudos
IanMurray
Frequent Contributor
It happens, especially on Fridays.  Glad you got it worked out.
0 Kudos