0

I recently installed regular Python on my workstation in addition to ArcGIS 10.2. Based on various things I found online, it seemed like the consensus was to install the full Python, because there are some libraries that ArcGIS's version of Python can't access. I am a Python noob so am trying to learn as I go. I've surely messed something up, but I don't know how to fix it!

I have been getting variations of this error in ArcMap:

>>> import numpy
Runtime error 
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 24, in <module>
from arcpy.toolbox import *
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\toolbox.py", line 342, in <module>
from management import Graph, GraphTemplate
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 22, in <module>
import _management
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\_management.py", line 14, in <module>
import _graph
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\_graph.py", line 27, in <module>
import numpy
ImportError: No module named numpy`

I followed the directions at this link to set the path variable for Python to the specified library folder in Windows. It worked and I was able to use the tool that I needed.

When I opened the .mxd that I'm currently working on, which is an Arch E size, the layout board was letter-sized with the data frame being the Arch E size. When I checked under the print settings, the only page size shown for the plotter was letter size.

When I removed the environment variable, my map document was "fixed" and my paper sizes were back.

I don't have any other Python folders in the location that the article mentions, C:\Python27\ArcGIS10.2\Lib\site-packages. I'd like to be able to use the full install of Python, but if I have to, I can uninstall it. I didn't have this NumPy error before installing Python, so my guess is that I overwrote something I shouldn't have. How should I go about trying to fix this?

1

Based off this in Stack Overflow... You need to find out where your python console is pointing.

I am guessing it is pointing to another python.exe that doesn't have the arcpy, numpy or other modules.

Open your python console and type this:

import sys
sys.executable
>> directory where your python.exe is..e.g. mine is 'C:\\Python27\\ArcGIS10.3\\python.exe'

Here you can tell if you installed another python that modified your path variable away from the ESRI modules. You can go back in and edit it back to the ArcGIS instance if necessary. Hopefully you didn't delete the modules in there to save from installing again.

After doing this... edit your question to reflect the new info. The rest below is more information to review and not entirely a solution to your problem.

As for your environment variables. You need to always pay close attention when editing these. My suggestion (without going through and re-doing every variable) is to check through your list there and make sure the delimiter ; is in there where it needs to be.

I find it easier to select the whole string, copy it, and paste it into Notepad to get a better look at it. Each of those values needs to be separated by a ; and they need to point to a directory. You might find you removed one or did something else that affected other ones in the string. Word of advice, if you are new to those, you should always keep a copy of the original string to revert back to if issues arise.

One of the easier things to do if you want to combine these things is install something like Pip or Easy_Install to the ArcGIS python directly. That way when you use them to install stuff like NumPy, it will install to that directory.

You may find this post beneficial to your needs, too. I found I wanted to be able to use different python installs together in the command prompt. It can give you an idea of ways to do things differently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.