Install MySQLdb (for python) as non-compressed egg

2020-07-18 06:32发布

The install instructions are:

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

This gives me an .egg file. How do I tell the install to dump the files as a normal, uncompressed library?

Thanks!

4条回答
\"骚年 ilove
2楼-- · 2020-07-18 06:56

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.

查看更多
做自己的国王
3楼-- · 2020-07-18 07:06

This will tell setuptools to not zip it up:

sudo python setup.py install --single-version-externally-managed
查看更多
Explosion°爆炸
4楼-- · 2020-07-18 07:14

OK, I hate to answer my own question, but:

find your python site-packages (mine is /usr/local/lib/python2.5/site-packages )

then:

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

This worked fine for me

查看更多
干净又极端
5楼-- · 2020-07-18 07:21

From the EasyInstall doc, command line options:

--always-unzip, -Z

Don't install any packages as zip files, even if the packages are marked as safe for running as a zipfile.

Can you use easyinstall instead of calling setup.py ?

calling easy_install -Z mysql_python from the command prompt, finds the egg on the net and installs it.

查看更多
登录 后发表回答