JamesRamm / archook

Searches the system for arcgis and makes arcpy available to python (regardless of pythonpath/system path/registry settings)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error importing arcpy in jupyter using anaconda 64 bit python3.4

sandeepgadhwal opened this issue · comments

this is the error which i am getting

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.5\arcpy\arcpy\__init__.py", line 22, in <module>
    from arcpy.geoprocessing import gp
  File "C:\Program Files (x86)\ArcGIS\Desktop10.5\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
ModuleNotFoundError: No module named '_base'

Is your ArcGIS version 64bit?

I see that you are using arcgis 10.5. Archook has never been tested against this version (it must be the latest?), so it is feasible there have been changes to directory paths.
Can you confirm that your ArcGIS directory (C:\Program Files (x86)\ArcGIS\Desktop10.5) contains a bin folder and bin64 folder?

_base is a pyd (a compiled extension module), so an ImportError would typically be generated by either of these:

  • mismatch between the bitness of the pyd, arcgis, python (64bit vs 32bit)
  • The directory containing _base was not added to the path.

Is _base in the bin64 directory?
Can you do a print(sys.path) after calling get_arcpy and paste the contents here?

I can see that the bin64 directory is correctly added to the path, as is the arcpy directory.
Can you confirm that either

C:/Program Files(x86)/ArcGIS/Desktop10.5/bin64
or
C:/Program Files (x86)/ArcGIS/Desktop10.5/arcpy
contains a _base.pyd file?

As far as I know, ArcGIS 10.5 for desktop still uses python 2.x, so there is a chance this causes problems. Try creating a new conda environment for python 2 and importing archook into that:

conda create -n py2 python=2.7
source activate py2
pip install archook numpy==1.9.3

P.S. github doesnt show images attached to emails

great

image

image

i have 64bit python installed by arcgis in C:\Python27\ArcGISx6410.5 when i import arcpy there i get this error.

Such errors are often caused by a mismatch in bitness. Since this appears to be a problem with the ArcGIS installation and not archook (you can create import problems without archook) then I suggest posting on the ArcGIS support forum?

Archook seems to be working correctly when you match up the correct python version, so I'll close this.

okay so can i import arcpy in 64bit windows or not.

Evidently in your current setup, you cant. Whether you are supposed to be able to is a question for the ArcGIS support (maybe there is a problem with your installation).

thanks james.