爱程序网

lib/sqlalchemy/cextension/processors.c:10:20: 致命错

来源: 阅读:

 

本文地址http://www.cnblogs.com/yhLinux/p/4063444.html

 

$ sudo easy_install sqlalchemy[sudo] password for ovonel: Searching for sqlalchemyReading http://pypi.python.org/simple/sqlalchemy/Best match: SQLAlchemy 0.9.8Downloading https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.9.8.tar.gz#md5=470ca4da4a0081efc830f0d90dd91682Processing SQLAlchemy-0.9.8.tar.gzRunning SQLAlchemy-0.9.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-niIczD/SQLAlchemy-0.9.8/egg-dist-tmp-K7Kb1xwarning: no files found matching '*.jpg' under directory 'doc'warning: no files found matching 'distribute_setup.py'warning: no files found matching 'sa2to3.py'warning: no files found matching 'ez_setup.py'no previously-included directories found matching 'doc/build/output'lib/sqlalchemy/cextension/processors.c:10:20: 致命错误: Python.h:没有那个文件或目录编译中断。

 

 出现这个问题的原因是,系统中的python是自带的,而没有安装python的开发包并没有安装,

所以在shell下执行如下命令:

$ sudo apt-get install python-dev

 

 

$ sudo easy_install sqlalchemySearching for sqlalchemyReading http://pypi.python.org/simple/sqlalchemy/Best match: SQLAlchemy 0.9.8Downloading https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.9.8.tar.gz#md5=470ca4da4a0081efc830f0d90dd91682Processing SQLAlchemy-0.9.8.tar.gzRunning SQLAlchemy-0.9.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Nu0lzS/SQLAlchemy-0.9.8/egg-dist-tmp-R1tVSzwarning: no files found matching '*.jpg' under directory 'doc'warning: no files found matching 'distribute_setup.py'warning: no files found matching 'sa2to3.py'warning: no files found matching 'ez_setup.py'no previously-included directories found matching 'doc/build/output'zip_safe flag not set; analyzing archive contents...sqlalchemy.testing.plugin.noseplugin: module references __file__Adding SQLAlchemy 0.9.8 to easy-install.pth fileInstalled /usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.9.8-py2.7-linux-x86_64.eggProcessing dependencies for sqlalchemyFinished processing dependencies for sqlalchemy

 

 缷载easy_install安装的包

(个人感觉easy_install没有pip方便,推荐大家使用pip安装和缷载https://pypi.python.org/pypi/pip

 

如何缷载esay_install安装的sqlalchemy呢,这里是官方文档:

https://pythonhosted.org/setuptools/easy_install.html#uninstalling-packages

 

$ sudo easy_install -m sqlalchemySearching for sqlalchemyBest match: SQLAlchemy 0.9.8Processing SQLAlchemy-0.9.8-py2.7.eggUsing /usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.9.8-py2.7.eggBecause this distribution was installed --multi-version, before you canimport modules from this package in an application, you will need to'import pkg_resources' and then use a 'require()' call similar to one ofthese examples, in order to select the desired version:    pkg_resources.require("SQLAlchemy")  # latest installed version    pkg_resources.require("SQLAlchemy==0.9.8")  # this exact version    pkg_resources.require("SQLAlchemy>=0.9.8")  # this version or higherProcessing dependencies for sqlalchemyFinished processing dependencies for sqlalchemy$ sudo easy_install -m SQLAlchemy==0.9.8Searching for SQLAlchemy==0.9.8Best match: SQLAlchemy 0.9.8Processing SQLAlchemy-0.9.8-py2.7.eggUsing /usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.9.8-py2.7.eggBecause this distribution was installed --multi-version, before you canimport modules from this package in an application, you will need to'import pkg_resources' and then use a 'require()' call similar to one ofthese examples, in order to select the desired version:    pkg_resources.require("SQLAlchemy")  # latest installed version    pkg_resources.require("SQLAlchemy==0.9.8")  # this exact version    pkg_resources.require("SQLAlchemy>=0.9.8")  # this version or higherProcessing dependencies for SQLAlchemy==0.9.8Finished processing dependencies for SQLAlchemy==0.9.8$ sudo rm /usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.9.8-py2.7.egg/ -r

 

(完)

关于爱程序网 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助