How do I create Python eggs from distutils source packages?

最后都变了- 提交于 2019-12-21 03:51:10

问题


I vaguely remember some sort of setuptools wrapper that would generate .egg files from distutils source. Can someone jog my memory?


回答1:


setuptools monkey-patches some parts of distutils when it is imported. When you use easy_install to get a distutils-based project from PyPI, it will create an egg (pip may do that too). To do the same thing locally (i.e. in a directory that’s a code checkout or an unpacked tarball), use this trick: python -c "import setuptools; execfile('setup.py')" bdist_egg.




回答2:


Have you tried

python setup.py bdist_egg

Here I assume you are using setuptools instead of distutils i.e.

in setup.py instead of

from distutils.core import setup

use

from setuptools import setup


来源:https://stackoverflow.com/questions/9950362/how-do-i-create-python-eggs-from-distutils-source-packages

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