需要搭建webservice环境,决定使用spyne模块
1. 安装distribute-0.6.26.tar.gz
最好安装上,否则有些软件安装会报错。
2. 安装lxml:
安装过程报错,原因为没有安装python-devel-2.6.0-8.9.20包,其次对“error: command 'gcc' failed with exit status 1”报错,还需要安装libxml2-dev和libxslt-dev包。
building 'lxml.etree' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fwrapv -fPIC -I/usr/include/libxml2 -I/root/lxml-3.0alpha2/src/lxml/includes -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.6/src/lxml/lxml.etree.o
src/lxml/lxml.etree.c:4:20: error: Python.h: No such file or directory
src/lxml/lxml.etree.c:6:6: error: #error Python headers needed to compile C extensions, please install development version of Python.
error: command 'gcc' failed with exit status 1
3. 安装spyne2.8.2
安装报错:“error: Could not find suitable distribution for Requirement.parse('pytz')" ,原因为没有安装pytz模块,需要先安装该模块
Installed /usr/local/lib64/python2.6/site-packages/spyne-2.8.2_rc-py2.6.egg
Processing dependencies for spyne==2.8.2-rc
Searching for pytz
Reading http://pypi.python.org/simple/pytz/
Download error on http://pypi.python.org/simple/pytz/: [Errno -2] Name or service not known -- Some packages may not be found!
Reading http://pypi.python.org/simple/pytz/
Download error on http://pypi.python.org/simple/pytz/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldn't find index page for 'pytz' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error on http://pypi.python.org/simple/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or download links found for pytz
error: Could not find suitable distribution for Requirement.parse('pytz')
总结: 为了安装spyne,需要先安装依赖模块,安装顺序为distribute,lxml,pytz,spyne