python - 如何制作 "python setup.py install"安装源而不是 egg 文件?

标签 python setuptools egg

我曾经在 python 项目中运行 python setup.py install,它只会将源代码移动到 site-packages,但有时它会 mv 一个 egg 文件到 site-packages?

#!/usr/bin/env python
# encoding: utf-8

from setuptools import setup,find_packages

setup(
    name = "ipin_rpc_gen_vector",
    version = "0.0.2",
    packages = find_packages("src"),
    package_dir={"":"src"},
    install_requires=[

    ],
)

那么这背后有什么区别呢?什么时候安装源代码,什么时候安装egg文件?如何强制安装源而不是 egg 文件?

最佳答案

如果您想避免 zip(鸡蛋)行为,您必须将 zip_safe 标志设置为 False

您可以在 https://setuptools.readthedocs.io/en/latest/userguide/miscellaneous.html#setting-the-zip-safe-flag 阅读更多相关信息.

另请查看 https://setuptools.readthedocs.io/en/latest/userguide/keywords.html#new-and-changed-setup-keywords*_package_data 标志(也位于:https://setuptools.readthedocs.io/en/latest/references/keywords.html)。

关于python - 如何制作 "python setup.py install"安装源而不是 egg 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33014356/

相关文章:

python - Pandas read_csv。如何忽略换行符前的定界符

python - 在 setup.py 中声明我的包的可选组件

Python:安装egg时出现权限问题

从 tar.gz 导入 Python 库?

python - BeautifulSoup - 将多个 <tr> 元素合并到一个列表中

python - 使用 Stanza 和 CoreNLPClient 提取名词短语

python - 动态 start_urls 值

python - 为什么安装了 setuptools 但仍然无法识别?

Python 打包文档

python - `pip freeze` 包安装中断