我正在尝试通过buildout在Ubuntu 10.04下安装GDAL-1.9.0,不幸的是会出现一个非常奇怪的错误。
python setup.py build
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "setup.py", line 75, in <module>
from distutils.command.build_ext import build_ext
File "/usr/lib/python2.6/distutils/command/build_ext.py", line 13, in <module>
from site import USER_BASE, USER_SITE
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 601, in <module>
main()
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 583, in main
known_paths = addusersitepackages(known_paths)
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 235, in getuserbase
from sysconfig import get_config_var
ImportError: No module named sysconfig
make[2]: *** [build] Error 1
make[2]: Leaving directory `/tmp/tmpY7oYvSbuildout-gdal/gdal-1.9.0/swig/python'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/tmp/tmpY7oYvSbuildout-gdal/gdal-1.9.0/swig'
make: *** [swig-modules] Error 2
gdal: cmmi failed: /tmp/tmpY7oYvSbuildout-gdal
While:
Installing gdal.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 1805, in main
getattr(buildout, command)(args)
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 584, in install
installed_files = self[part]._call(recipe.install)
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 1297, in _call
return f()
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.recipe.cmmi-1.3.5-py2.7.egg/zc/recipe/cmmi/__init__.py", line 113, in install
self.build()
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.recipe.cmmi-1.3.5-py2.7.egg/zc/recipe/cmmi/__init__.py", line 196, in build
self.cmmi(dest)
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.recipe.cmmi-1.3.5-py2.7.egg/zc/recipe/cmmi/__init__.py", line 222, in cmmi
system("make")
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.recipe.cmmi-1.3.5-py2.7.egg/zc/recipe/cmmi/__init__.py", line 34, in system
raise SystemError("Failed", c)
SystemError: ('Failed', 'make')
这是gdal的buildout.cfg部分:
[gdal]
recipe = zc.recipe.cmmi
url = http://download.osgeo.org/gdal/gdal-1.9.0.tar.gz
extra_options =
--with-python
--with-geos=${geos:location}/bin/geos-config
更奇怪的是,当我要去python2.7 shell并尝试导入sysconfig时。一切都很好。有关于此的任何建议吗?
谢谢, 塞吉
答案 0 :(得分:1)
你提到你在'python2.7'shell中测试过它。
此:
File "/usr/lib/python2.6/distutils/command/build_ext.py",
意味着buildout在python 2.6中运行。
你的python2.6环境中是否有sysconfig,或者你是否在错误的版本下运行buildout?