Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have ArcGIS 10.2 installed on my machine. When ArcGIS was installed, python 2.7.3(32 bits) was also installed. I need python 2.7.5 64bits for some gdal functions. So I installed python 2.7.5 64bits stand alone. Now there are two python installed with two python shells. One (2.7.3 32bits) can be started from Start---->All Programs--->Python27--->IDLE(GUI). The other(2.7.5 64bits) is from Start---->All Programs--->ArcGIS--->Python27--->IDLE(GUI).

Till now I have my work done in python2.7.5 64bits. Now I want to integrate a model I built in Modelbuilder ArcGIS 10.2. I export this model to python script so that I can see the code behind. I need to import ArcPy module to use ArcPy functions. I tried several ways but no good luck. Is there any way that I can import arcpy module in this python shell (2.7.5 64bits, not the one installed with ArcGIS)? Should I install arcpy package first, like what I did for other module? But I didn't see where to download it. Thank you!

Solved:Thanks to all the folks here! Finally it is resolved. So I followed the link given by @PolyGeo and asked our IT staff to download the package and installed for me. Now my python (came with ArcGIS) is 2.7.5 64bit. I also uninstalled the stand alone python. Re-install all the modules.

share|improve this question
    
This ESRI post about 64 bit processing in Python may be helpful.blogs.esri.com/esri/arcgis/2012/11/12/… –  klewis Jun 24 at 23:16
    
Thank you Klewis! I read the news and it seems like it targets ArcGIS 10.1. But I didn't find the same thing for 10.2. If you find it, please let me know! –  shirleydd Jun 24 at 23:25
2  
This other python module, did you install that yourself or is that the one that came with ArcGis 10.1? Many problems can occur with multiple versions of python on the same computer, they can usually be sorted but there's a bit of work to it. Most likely the install can't find the Esri libs or doesn't have the prerequisites to start them. It is best to use ArcPy with the python that is installed with the current version of ArcGis. –  Michael Miles-Stimson Jun 24 at 23:30
    
Thank you @MichaelMiles-Stimson! I installed another python (2.7.5). I also used gdal module and pyodbc module, which do not come with ArcGIS 10.2. In the beginning, the problem is that python 2.7.5 cannot find arcpy. So I followed some suggestion to put a PTH file in C:\Python27\Lib\site-packages. Its contents are: C:\Program Files (x86)\ArcGIS\Desktop10.2\bin C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts..Then when I tried to import arcpy in python shell, it says: ImportError: DLL load failed: %1 is not a valid Win32 application. –  shirleydd Jun 24 at 23:37
2  
That error says I can't find the file that it's asking for but that could just as easily mean that's a 64 bit lib in a 32 bit python. It is best to use the python that was installed with ArcGis if you want to use ArcPy; if you want to use GDAL too then adjust that pythons' paths to suit GDAL. It's easier to adjust to suit GDAL than Esri! –  Michael Miles-Stimson Jun 24 at 23:45

1 Answer 1

You'll need to get a 64 bit ArcGIS installation of some sort to get arcpy to work correctly in a 64 bit installation. The most expedient thing would be to install 64 bit background geoprocessing for your current install of ArcGIS. That will install a 64 bit version of all the necessary Python libraries needed to use arcpy.

share|improve this answer
    
Thank you Jason! I guess esri is going to release ArcGIS Pro, which is a 64bit one, soon? I tried your method. But I only found 64 bit background geoprocessing for 10.1, not 10.2. I am wondering whether there is one for 10.2 since I tried to install the one for 10.1 and it is failed. –  shirleydd Jun 24 at 23:31
2  
There should be a 64 bit background GP somewhere for 10.2, though I wouldn't know where to look either. Pro App is going to be 64 bit, yes, but it's also going to be based on Python 3.4 instead of 2.7 and some APIs (namely arcpy.mapping) are being totally overhauled so it won't be a clean 1:1 upgrade path. –  Jason Scheirer Jun 24 at 23:34
    
Thanks Jason. Yap, I guess so, but I didn't find it either...I think I will keep look for and trying some ways I found. If none of them works, I have to try to use python2.7.3 which came with ArcGIS. That is 32bit right? –  shirleydd Jun 24 at 23:42
2  
This may help you locate the 64bit install for 10.2: gis.stackexchange.com/questions/80459/… –  PolyGeo Jun 25 at 0:06
1  
Thank you @PolyGeo! Got it working :) –  shirleydd Jun 25 at 14:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.