Running x64 bit geoprocessing Python in Python IDLE 2.7.6 x64 error

1264
2
05-15-2014 04:54 PM
ClintonCooper1
New Contributor III
I am trying to set the Python IDLE 2.7.6 x64 to run the arcpy module from ArcGIS x64 bit geoprocessing (10.2.2).  I copied the file DTBGGP64.pth from C:\Python27\ArcGISx6410.2\Lib\site-packages to C:\Python27\Lib\site-packages that is written as:

C:\Program Files (x86)\ArcGIS\Desktop10.2\bin64
C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy
C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts


when I then open the python 2.7.6  x64 IDLE and run the following command : import Arcpy,  I get this error

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import arcpy
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\__init__.py", line 24, in <module>
    from arcpy.toolbox import *
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\toolbox.py", line 356, in <module>
    from management import Graph, GraphTemplate
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 22, in <module>
    import _management
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\_management.py", line 14, in <module>
    import _graph
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\_graph.py", line 27, in <module>
    import numpy
ImportError: No module named numpy


it seems to me that the 10.2.2 x64 bit python is pointing to the 32 bit python library.  I have tried substituting the code from:  http://resources.arcgis.com/en/help/main/10.2/index.html#//002z00000008000000

c:\Program Files\ArcGIS\Desktop10.2.2\arcpy
c:\Program Files\ArcGIS\Desktop10.2.2\bin
c:\Program Files\ArcGIS\Desktop10.2.2\ArcToolbox\Scripts


I get the error that it cannot even find the arcpy module.
Any thought on how to solve this?  Thanks in advance!
Tags (2)
0 Kudos
2 Replies
ClintonCooper1
New Contributor III
my ultimate goal is to get the arcpy module to run in spss 22 which is built on the Python 2.7.1 x64 framework.  However even when I put the  DTBGGP64.pth  file in the site-packages folder of that module, I get the same exact traceback error that it cannot find Numpy

Clinton
0 Kudos
curtvprice
MVP Esteemed Contributor

1. Delete C:\Python27\ArcGIS10.2\site-packages\DTBGGP64.pth. pth files should only point to modules that are of the same type x32 or x64. Your spss modules are x64 so you cannot import them in ArcMap foreground processing - which is always 32 bit python.

2. To avoid breaking python paths needed for ArcGIS, you can take advantage of the fact that .pth files are loaded in alphabetical order. To force the spss stuff to load last so it won't break ArcGIS, you can try renaming your file DTBGGP64.pth to zzDTBGGP64.pth -- again, in the Python x64 site-packages folder ONLY.

3. This may or may not work depending on the dependencies in the spss modules -- which may be different from ArcGIS.  There are situations where you need to install a separate Python and run it using the subprocess module in its own thread.

Note that to get any of these changes to take, you need to restart Python. In the case of Desktop, that means you need to shut down ArcMap/ArcCatalog and start it again to restart the in-process Python session.

Hope this helps you out!

0 Kudos