简体   繁体   English

Pip 7.0.1不安装软件包中包含的文件

[英]Pip 7.0.1 not installing included files from package

I have a python package as a .tar.gz. 我有一个python软件包作为.tar.gz。 I have been using pip 6.1.1 without error for sometime. 我已经使用pip 6.1.1一段时间了,没有错误。 When installing the package, pip install mypackage.tar.gz , distutils ensure that certain files in the package are put into this /var/www/myfolder location. 安装软件包时,请pip install mypackage.tar.gz ,distutils确保将软件包中的某些文件放入/var/www/myfolder位置。

Pip 6.1.1 and Pip 1.2.1 follow this behaviorcorrectly, however pip 7.0.1 does not. 点子6.1.1和点子1.2.1正确地遵循此行为,但是点子7.0.1却没有。 Pip 7.0.1 does not move the files in the "myfolder" directory at all. Pip 7.0.1根本不移动“ myfolder”目录中的文件。

At first I though its was a distutils issue, however now that I realize the only scenario in which mypackage.tar.gz does not move files into the /var/www/myfolder location is when it is installed by pip withversion 7.0.1 I conclude its a pip issue. 起初我虽然是distutils问题,但是现在我意识到mypackage.tar.gz不会将文件移动到/var/www/myfolder位置的唯一情况是通过pip withversion 7.0.1安装时。结束一个小问题。

I haven't found anything of significance in the change docs between the version of pip, but I'm not sure what I may be looking for. 在pip版本之间的更改文档中,我还没有发现任何重要意义,但是我不确定自己在寻找什么。

Any idea what could be happening? 知道会发生什么吗?

Note it is not a permissions issue as I run the pip commands with sudo. 请注意,这不是权限问题,因为我使用sudo运行pip命令。

Starting with version 7.0.0 pip builds wheels from sdists and installs these wheels instead of installing directly from sdists. 从7.0.0版开始,pip从sdists构建轮子并安装这些轮子,而不是直接从sdists安装。 There's a known difference in where data_files are installed between installing from wheel and from sdist. 从wheel安装和从sdist安装之间存在data_files安装位置的已知区别。 Citing from Packaging and Distributing Projects : 引用包装和分配项目

setuptools allows absolute “data_files” paths, and pip honors them as absolute, when installing from sdist. setuptools允许绝对的“ data_files”路径,从sdist安装时,pip会将其视为绝对路径。 This is not true when installing from wheel distributions. 从车轮分配上安装时,情况并非如此。 Wheels don't support absolute paths, and they end up being installed relative to “site-packages”. 轮子不支持绝对路径,因此最终会相对于“站点包”进行安装。 For discussion see wheel Issue #92 . 有关讨论,请参见第92期

See also: 也可以看看:

Wheel issue 92: bdist_wheel makes absolute data_files relative to site-packages 转轮问题92: bdist_wheel使相对于站点包的绝对data_files
PyPI Metadata Formats issue 13: Add a new subdirectory to allow wheels to bypass installation schemes PyPI元数据格式问题13: 添加新的子目录,以允许轮子绕过安装方案
Python Packaging User Guide pull 212: Fix section on data_files Python打包用户指南第 212页: 修复data_files部分
Presentation by Ionel Cristian Mărieș - Less known packaging features and tricks Ionel Cristian Mărieș的演讲- 鲜为人知的包装功能和窍门

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM