OpenERP7.0用户手册,OSCG淘宝OpenERP用户手册,OpenERP7.0开发教程

2014-2-28 foooy python

 

OpenERP7.0用户手册,OSCG淘宝OpenERP用户手册,OpenERP7.0开发教程

 

转载:http://www.oscg.cn/

标签: python OpenERP

评论(0) 浏览(3985)

MySQLdb/mysql-python安装时EnvironmentError: mysql_config not found

2012-7-19 foooy python

python setup.py install 

sh: mysql_config: not found
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    metadata, options = get_config()
  File "/root/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
    libs = mysql_config("libs_r")
  File "/root/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
    raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

原因mysql_config.path位置不对,首先查找mysql_config的位置,使用find / -name mysql_config,可以找到位置,本人的是/data/webserver/mysql/bin/mysql_config

修改setup_posix.py26行:

mysql_config.path = "mysql_config" 修改为:
mysql_config.path = " /data/webserver/mysql/bin/mysql_config " //这里是你搜索到的位置
修改完成后保存,再执行
python setup.py build
python setup.py install
python setup.py bdist_rpm

评论(0) 浏览(203816)

import MySQLdb UserWarning错误

2012-7-19 foooy python

import MySQLdb

/usr/lib/python2.4/site-packages/MySQL_python-1.2.3-py2.4-linux-i686.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/lib/python2.4/site-packages/MySQL_python-1.2.3-py2.4-linux-i686.egg/_mysql.pyc, but /root/soft/MySQL-python-1.2.3 is being added to sys.path

 

原因是,install后MySQLdb模块已经被放到python的site-pachages目录中;但我在当前目录也存在相同的模块,所以可能会重复导入。只要切换到其他目录运行就可以了。

评论(0) 浏览(220741)

Centos安装安装MySQLdb模块

2012-7-19 foooy python

1、下载安装python setup编译工具 

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c9.tar.gz
tar zxvf setuptools-0.6c9.tar.gz
cd setuptools-0.6c9
python setup.py build
sudo python setup.py install

2、下载安装MySQLdb模块

https://pypi.python.org/pypi/MySQL-python

wget http://nchc.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
tar zxvf MySQL-python-1.2.3.tar.gz
cd MySQL-python-1.2.3
python setup.py build
python setup.py install

 

3、测试是否可用

python
import MySQLdb
如果没有报错,说明已经安装好了

评论(0) 浏览(49629)

python 模块 卸载

2012-7-19 foooy python

第一中方式:
如果模块安装包里没有setup.py uninstall这个选项的话,可以到site-packages包里删除相应的.egg文件

第二中方式:
从新运行安装程序,增加--record参数然后删除
python ./setup.py install --record install.txt
cat install.txt | xargs rm -rf

标签: linux centos python

评论(0) 浏览(1089)

Powered by emlog 鄂ICP备14000186号-1 sitemap