Python in ArcGIS 10.3

24640
34
06-10-2014 10:25 AM
MathewCoyle
Frequent Contributor
http://gisinc.com/talk/2014-esri-international-developer-summit-day-2-recap
Python 3.4 will be supported with ArcGIS for Professionals

Does any know for certain which version of Python will ship with 10.3? Since it comes with ArcGIS for Professionals I thought it would be 3.4 but I haven't found any officials sources. Previous sources seemed to indicate ArcGIS 11 would be moving to 3.x but I'm not sure if this product release was renamed or that release was pushed back.
Tags (2)
34 Replies
JessicaGooch1
Occasional Contributor

Hi All-

I just installed ArcGIS 10.3 and now pythonwin is giving me an error message:

Python Traceback

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\Python27\ArcGIS10.2\Lib\site-packages\Pythonwin\pywin\framework\startup.py", line 49, in <module>

    __import__(moduleName)

  File "C:\Python27\ArcGIS10.2\Lib\site-packages\Pythonwin\pywin\framework\intpyapp.py", line 3, in <module>

    import win32con

ImportError: No module named win32con

Any ideas on how to fix this??? Google is not helping...

Thanks!

Jessica

JohnLang1
New Contributor

Hi Jessica,

Same problem, I am getting our IT group to look at this, but wondered if you had an answer. I assume it is because the ArcGIS libraries have moved to C:\Python27\ArcGIS10.3\Lib\site-packages\ but can't get PyWin to work to get to this....

John

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "pywin\framework\startup.py", line 49, in <module>

    __import__(moduleName)

  File "C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin\pywin\framework\intpyapp.py", line 3, in <module>

    import win32con

ImportError: No module named win32con

0 Kudos
JohnLang1
New Contributor

Hi Jessica,

Yes the problem is that ArcGIS10.3 installs the python libraries to C:\Python27\ArcGIS10.3\Lib\

Uninstalling pywin and re-installing pywin32 (pywin32-218.win32-py2.7.exe)

The pythonwin.exe is now in the ArcGIS10.3 folder at the location below and everything works

C:\Python27\ArcGIS10.3\Lib\site-packages\pythonwin\Pythonwin.exe

John

0 Kudos
AndrewKuder
New Contributor

I know this is a couple months old by now but I just upgraded to 10.3 and am getting a similar error:

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\__init__.py", line 21, in <module>

    from arcpy.geoprocessing import gp

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>

    from _base import *

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 598, in <module>

    env = GPEnvironments(gp)

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 595, in GPEnvironments

    return GPEnvironment(geoprocessor)

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 551, in __init__

    self._refresh()

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 553, in _refresh

    envset = (set(env for env in self._gp.listEnvironments()))

RuntimeError: NotInitialized

I am working off a concurrent license server so not sure if that could be the issue or not.  Also I was utilizing PythonWin prior to the upgrade, which I prefer, however once my system was upgraded PythonWin no longer functions.  Pretty much a noob at Python so please respond with as much laymans terminology as possible.

Thanks!

0 Kudos
DanPatterson_Retired
MVP Emeritus

I had python 2.7.9, numpy and matplot lib, pyscripter and pythonwin installed on a clean brand new machine for some work I needed to do.  I then installed 10.3 ... pythonwin no longer worked but Pyscripter did.  I uninstalled and reinstalled pythonwin and everything now works.  The only strange thing is that I now have 2 lib folders and 2 site package folders as such:

C:\Python27\Lib\site-packages                       what I had during the original install

C:\Python27\ArcGIS10.3\Lib\site-packages   after 10.3 was installed.

with pythonwin now being installed in the last site-packages folder and removed from the former.  Of course the python paths differ in both applications...but so far everything works

0 Kudos
curtvprice
MVP Esteemed Contributor

The top one is standalone Python.

The one with ArcGIS in the path is a whole separate Python that Esri installs when you install ArcGIS Desktop.

If you install 64 bit background processing, you'll have yet a third Python in place.

The last one installed is the one windows will run when you try to simply "execute" a .py file from the shell (cmd.exe), for example when you throw a .py at Scheduled Tasks.

0 Kudos
AndrewKuder
New Contributor

Thanks.  I did do the reinstall and now Python Win is opening however I am still getting the Traceback error when I try to run a script.

0 Kudos
DanPatterson_Retired
MVP Emeritus

what is the error?

0 Kudos
AndrewKuder
New Contributor

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\__init__.py", line 21, in <module>

    from arcpy.geoprocessing import gp

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>

    from _base import *

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 598, in <module>

    env = GPEnvironments(gp)

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 595, in GPEnvironments

    return GPEnvironment(geoprocessor)

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 551, in __init__

    self._refresh()

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 553, in _refresh

    envset = (set(env for env in self._gp.listEnvironments()))

RuntimeError: NotInitialized

Reinstalling Python Win didn't fix this error unfortunately

0 Kudos
DanPatterson_Retired
MVP Emeritus

If you examine those two ...\lib\site-packages folders, I suspect that pythonwin is not installed in the one with the 10.3 root, but in the other one which is for pure python.  With my installation order I had no issues.  So if you can't do

>>> import arcpy 

from pythonwin interactive prompt, then it is not in the correct path and you may have to reorder the python path file...since I haven't had this issues, I can't help

0 Kudos