[英]How do I create Python eggs from distutils source packages?
I vaguely remember some sort of setuptools wrapper that would generate .egg files from distutils source. 我隐约记得某种可以从distutils源生成.egg文件的setuptools包装器。 Can someone jog my memory? 有人可以慢跑我的记忆吗?
setuptools monkey-patches some parts of distutils when it is imported. setuptools在导入distutils的某些部分时会对其进行修补。 When you use easy_install to get a distutils-based project from PyPI, it will create an egg (pip may do that too). 当您使用easy_install从PyPI获取基于distutils的项目时,它将创建一个鸡蛋(pip也可以这样做)。 To do the same thing locally (ie in a directory that's a code checkout or an unpacked tarball), use this trick: python -c "import setuptools; execfile('setup.py')" bdist_egg
. 要在本地(即在代码签出目录或解压缩的tarball目录中)执行相同操作,请使用以下技巧: python -c "import setuptools; execfile('setup.py')" bdist_egg
。
Have you tried 你有没有尝试过
python setup.py bdist_egg
Here I assume you are using setuptools instead of distutils ie 在这里,我假设您使用的是setuptools而不是distutils,即
in setup.py instead of 在setup.py中而不是
from distutils.core import setup
use 使用
from setuptools import setup
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.