Select to view content in your preferred language

ArcMap with Python

3786
4
04-29-2015 12:47 PM
MiguelHoyos
Deactivated User

Hello,

I can't import the arcpy module from the Python window. It seems to be a problem with the numpy module. What can i do? I have ArcMap 10.2.2

Tags (3)
0 Kudos
4 Replies
SepheFox
Deactivated User

What happens exactly when you type import arcpy from the Python window?

0 Kudos
MiguelHoyos
Deactivated User

>>> import arcpy

Runtime error

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  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

0 Kudos
DanPatterson_Retired
MVP Emeritus

not installed properly...​

0 Kudos
DanPatterson_Retired
MVP Emeritus

Which Python window?  The IDE built into arcmap?  Pythonwin? PyScripter?

If it is something other than within ArcMap, then you need to import them explicitly,

>>> import arcpy
>>> import numpy  # if you want to use the namespace numpy

OR

>>> import numpy as np # the usual nickname for numpy​

If neither of these work, your installation is broken and you will need to reinstall.  It is recommended that you let ArcMap install where it wants to.  Also, if you are not familiar with Python, it would be a good idea to uninstall any previous installations that exist on disk, then install ArcMap and reinstall other installations if you know how to work with Python paths etc.  Fixing a Python install can be done, but I don't recommend it. Running a different version on a separate machine is cheaper if you include debug time.

0 Kudos