装好python2.7.3后运行Zarp会报如下错误:
ImportError: No module named 之类的错误,说明没装所需模块。
Zarp需要netlib和flask、sqlite3
要安装netlib可以用pip进行安装,然后用easy_install安装flask. 一.我的系统是centos,首先安装python2.7.3:1、安装开发工具 yum groupinstall "Development tools"
2、安装其它需要的包 yum install zlib-devel bzip2-devel openssl-devel ncurses-devel 3、下载并解压缩 Python2.7.3 mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python 由于yum依赖python2.6.6才能正常工作,必须对其进行修改 vi /usr/bin/yum
将文件头部的
#!/usr/bin/python
改成
#!/usr/bin/python2.6.6 二.安装PIP及Flask安装pip必须先安装setuptools wget http://pypi.python.org/packages/ ... ls-0.6c11-py2.7.egg --no-check-certificatesh setuptools-0.6c11-py2.7.egg安装PIP wget http://pypi.python.org/packages/source/p/pip/pip-1.0.2.tar.gz --no-check-certificatetar zxf pip-1.0.2.tar.gzcd pip-1.0.2python setup.py install再安装netlib pip-2.7 install netlib (安装好pip后就带了easy_instal命令,也可用yum下载 yum -y install python-pip)安装flasksudo easy_install Flask如果提示找不到sqlite3模块,需要下载下载模块,并重新编译python: 2.先修改python setup.py 文件
在 sqlite_inc_paths 中添加sqlite的include 路径
如:
sqlite_inc_paths = [ '/usr/include',
'/usr/include/sqlite',
'/usr/include/sqlite3',
'/usr/local/include',
'/usr/local/include/sqlite',
'/usr/local/include/sqlite3',
'/usr/local/sqlite3/include',
'/usr/local/sqlite3/include/sqlite3',
] 再重新安装python2.7.3即可,检测安装是否成功>>import sqlite3 |