arcpy and virtualenv

1090
4
11-28-2011 01:06 PM
TedCronin
MVP Honored Contributor
Is arcpy expected to have no problems when running inside virtualenv?  Definitely issues with numpy, but graphs as well...


>>> import arcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\__init__.py", line 25, i
n <module>
    from arcpy.toolbox import *
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\toolbox.py", line 342, i
n <module>
    from management import Graph, GraphTemplate
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 22,
in <module>
    import _management
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\_management.py", line 14
, in <module>
    import _graph
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\_graph.py", line 27, in
<module>
    import numpy
ImportError: No module named numpy
>>>
Tags (2)
0 Kudos
4 Replies
JasonScheirer
Occasional Contributor III
You're going to have to manually tweak the path files in the virtualenv to point to the correct NumPy path or install it within the Virtualenv when you bootstrap it. Is there a reason you're using virtualenv?
0 Kudos
TedCronin
MVP Honored Contributor
just playing around with other third party modules, but figured I would attempt with arcpy.  I have tried to install numpy through pip, but there have been issues, so I will play around with manually trying to get it to work.  So, you think that once I get numpy up, I could conceivably run arcpy virtually?
0 Kudos
JasonScheirer
Occasional Contributor III
No, bare minimum you're going to need an Engine/Desktop/Server install. Arcpy isn't just that directory full of .py files -- it's all of ArcObjects with bindings specific to the version of Python included with the product.
0 Kudos
TedCronin
MVP Honored Contributor
sounds like a lot of work for after beta :=)
0 Kudos