Install MySQLdb (for python) as non-compressed egg

回眸只為那壹抹淺笑 提交于 2020-06-25 04:20:14

问题


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!


回答1:


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




回答2:


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:


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.




回答4:


This will tell setuptools to not zip it up:

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


来源:https://stackoverflow.com/questions/268025/install-mysqldb-for-python-as-non-compressed-egg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!