简体   繁体   English

安装MySQLdb(用于python)作为非压缩egg

[英]Install MySQLdb (for python) as non-compressed egg

The install instructions are: 安装说明如下:

$ python setup.py build
$ sudo python setup.py install # or su first

This gives me an .egg file. 这给了我一个.egg文件。 How do I tell the install to dump the files as a normal, uncompressed library? 如何告诉安装将文件转储为普通的未压缩库?

Thanks! 谢谢!

OK, I hate to answer my own question, but: 好的,我不想回答我自己的问题,但是:

find your python site-packages (mine is /usr/local/lib/python2.5/site-packages ) 找到你的python site-packages(我的是/usr/local/lib/python2.5/site-packages)

then: 然后:

$ unzip MySQL_python-1.2.2-py2.5-linux-i686.egg

This worked fine for me 这对我来说很好

I'm a little late to this party, but here's a way to do it that seems to work great: 我参加这个聚会有点晚了,但这是一种方法,它看起来效果很好:

sudo python setup.py install --single-version-externally-managed --root=/

And then you don't use a .python-egg, any *.pth files etc. 然后你不使用.python-egg,任何* .pth文件等。

From the EasyInstall doc, command line options: EasyInstall doc,命令行选项:

--always-unzip, -Z --always-unzip,-Z

Don't install any packages as zip files, even if the packages are marked as safe for running as a zipfile. 不要将任何软件包安装为zip文件,即使这些软件包被标记为可以安全地运行为zipfile。

Can you use easyinstall instead of calling setup.py ? 你可以使用easyinstall而不是调用setup.py吗?

calling easy_install -Z mysql_python from the command prompt, finds the egg on the net and installs it. 从命令提示符调用easy_install -Z mysql_python ,在网上找到鸡蛋并安装它。

这将告诉setuptools不要压缩它:

sudo python setup.py install --single-version-externally-managed

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM