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

ImportError when numpy is *not* installed by the user

logan-pugh opened this issue · comments

So I recreated a virtual environment using this library and wondered why I was now getting an ImportError with archook and ArcGIS Pro; turns out in my previous venv I had manually installed numpy in my standalone Python interpreter's site packages.

Without that, importing arcpy with pro=True will fail with an error similar to the following.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 21, in <module>
    import numpy
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import _distributor_init
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
    from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.

I will issue a PR with a fix for this!