pip:为什么有时以鸡蛋的形式安装,有时以文件的形式安装 [英] pip: Why sometimes installed as egg, sometimes installed as files

查看:121
本文介绍了pip:为什么有时以鸡蛋的形式安装,有时以文件的形式安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在哪里强制将pip安装为扁平"而不是鸡蛋".

Where can you force pip to install as "flat" and not as "egg".

对我来说,这似乎是随机的.有时它会像鸡蛋一样被安装,有时会像鸡蛋一样被安装.

For me it seems random. Sometimes it gets installed as egg, sometime as flat.

pip help install仅显示选项--egg,该选项强制安装Egg.但是我找不到--flat选项.

pip help install shows only an option --egg which forces an egg installation. But I could not find a --flat option.

这些软件包来自自己的pypiserver,并按以下方式上传:

The packages are from an own pypiserver, and uploaded like this:

python setup.py sdist upload -r internal

安装过程中的点输出:

Best match: foo-client 2015.2
Downloading https://installserver:40443/pypi/packages/foo_client-2015.2.tar.gz
Processing foo_client-2015.2.tar.gz
Writing /home/bar_eins_daad/tmp/easy_install-z20B7b/foo_client-2015.2/setup.cfg
Running foo_client-2015.2/setup.py -q bdist_egg --dist-dir /home/bar_eins_daad/tmp/easy_install-z20B7b/foo_client-2015.2/egg-dist-tmp-GO1snX

我不知道为什么在这里使用bdist_egg.它会强制创建鸡蛋安装吗?

I don't know why bdist_egg gets used here. Does it force creating an egg install?

setup.py确实使用setuptools而不是distutils.

我们pypiserver上的软件包如下:

The package on our pypiserver looks like this:

tar -tzf packages/foo_client-2015.3.tar.gz

内容:

foo_client-2015.2/
foo_client-2015.2/foo_client.egg-info/
foo_client-2015.2/foo_client.egg-info/SOURCES.txt
foo_client-2015.2/foo_client.egg-info/top_level.txt
foo_client-2015.2/foo_client.egg-info/dependency_links.txt
foo_client-2015.2/foo_client.egg-info/PKG-INFO
foo_client-2015.2/setup.cfg
foo_client-2015.2/PKG-INFO
foo_client-2015.2/foo_client/
foo_client-2015.2/foo_client/models.py
...

背景

如果安装了压缩鸡蛋,pip有时有时会多次安装软件包.

pip seems to sometimes install packages several times if zipped eggs are installed.

更新

我发现在哪种情况下该软件包以egg的形式安装:如果是通过python setup.py develop安装的(它是install_requires依赖项).

I found under which condition the package gets installed as egg: if it gets installed via python setup.py develop (it is an install_requires dependency).

如果我使用pip install foo_client,它会以我想要的方式固定安装.

If I use pip install foo_client it gets installed flat (the way I want it).

Update2

非常丑陋的部分:如果安装了鸡蛋,则不会删除旧版本的平面安装版.

The very ugly part: If the egg gets installed, the old version installed flat does not get removed.

版本:点1.5.6

推荐答案

这不能解决为什么我有时会拉上拉链蛋,而有时却不拉皮的问题.但这很有帮助.

This does not solve the question why I get sometimes zipped eggs, and sometimes not. But it helps.

您可以在~/.distutils.cfg中使用它来避免安装压缩鸡蛋:

You can use this in your ~/.distutils.cfg to avoid installation of zipped eggs:

[easy_install]
zip_ok = False

这篇关于pip:为什么有时以鸡蛋的形式安装,有时以文件的形式安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆