Search code examples
pythonnumpymatplotlibarcpyarcmap

import arcpy results in ImportError: cannot import name shares_memory


I recently upgraded my ESRI ArcDesktop software to version 10.5, but now when I run any of my python scripts that require the arcpy module be imported, I get the below error:

>>> import arcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\__init__.py", line 20, i
n <module>
    import numpy
  File "c:\python27\ArcGIS10.5\lib\site-packages\numpy\__init__.py", line 142, in <mod
ule>
    from . import add_newdocs
  File "c:\python27\ArcGIS10.5\lib\site-packages\numpy\add_newdocs.py", line 13, in <m
odule>
    from numpy.lib import add_newdoc
  File "c:\python27\ArcGIS10.5\lib\site-packages\numpy\lib\__init__.py", line 8, in <m
odule>
    from .type_check import *
  File "c:\python27\ArcGIS10.5\lib\site-packages\numpy\lib\type_check.py", line 11, in
 <module>
    import numpy.core.numeric as _nx
  File "c:\python27\ArcGIS10.5\lib\site-packages\numpy\core\__init__.py", line 21, in
<module>
    from . import function_base
  File "c:\python27\ArcGIS10.5\lib\site-packages\numpy\core\function_base.py", line 7,
 in <module>
    from .numeric import (result_type, NaN, shares_memory, MAY_SHARE_BOUNDS,
ImportError: cannot import name shares_memory

I have done some googling but have come up empty handed.

So far I have tried uninstalling and reinstalling numpy and matplotlib.

If I run the command pip install numpy it tells me the Requirement is already satisfied (which I assume means it is installed no worries).

Then I run pip install matplotlib, this also installs no worries, telling me Successfully installed matplotlib-2.0.2

I am stumped and not sure how to proceed.

Any suggestions greatly appreciated.

EDIT: I am running Windows 7, I am unsure if that changes anything.


Solution

  • Try

    pip install numpy --upgrade
    

    This will fetch the latest version.