v8 - how to add path with module to python? -
i try build v8 javascript engine. when try invoke command python build/git_v8
, error:
file build/gyp_v8, line 48 in < module > import gyp importerror: no module named gyp
how can tell python search gyp module , correct path module in folder gyp?
my version of python 2.6.2.2, recommended in build instructions.
obviously, module gyp.py not in search path of modules (sys.path). sys.path array variable in sys module contains known paths of modules. can add directory containing module gyp.py manually either of these methods:
set via pythonpath environment variable (see http://docs.python.org/3/using/cmdline.html?highlight=path#envvar-pythonpath)
add path manually within python script prior importing gyp. example, if directory containing module /home/you/gyp:
import os, sys sys.path.append('/home/you/gyp') import gyp #--------- that's ------------
you can check if path exists using debug lines
import sys print(sys.path) # version python 3.2
or
print sys.path # version python 2.7
Comments
Post a Comment