Fixing ArcGIS 10.1 Numpy Import Error From Python Console
At my current employer, we have four Windows 7 64-bit workstations, all running ArcGIS 10.1 under
various license levels. Hilariously, due to some quirk that I haven’t been able to figure out,
all machines have been reporting the following traceback when running
>>> import numpy from
ArcGIS Desktop’s internal Python console.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
One solution to this is to explicitly append the
PYTHONPATH environment variable to reference the ArcGIS10.1 Python install’s
Creation of PYTHONPATH Environment Variable
From the start menu, right click the
computerbutton and select
Advanced System Settings.
Advancedtab, and select the
Newto create a new environment variable.
Name the environment variable
PYTHONPATHand set it’s value to point to the
site-packagesdirectory for ArcGIS. For my instance, this is
Restart the machine. You should now be able to successfully import numpy, arcpy, and any other Python modules installed as part of the ArcGIS 10.x version of Python.