点创建构建/目录 [英] Pip creates build/ directories

查看:77
本文介绍了点创建构建/目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用virtualenv为我的Python项目创建隔离的环境.然后我用pip-Python程序包管理器安装依赖项.有时我忘记做source venv/bin/activate,然后pip在我的项目中创建了build/目录.点子为什么要创建它们?我可以删除它们,如果不能删除,可以将它们放在我的.hgignore文件中吗?

I use virtualenv to create isolated environments for my Python projects. Then i install dependencies with pip - Python package manager. Sometimes i forget to do source venv/bin/activate, and then pip creates build/ directories inside my projects. Why does pip create them? May i delete them, and if not, may i put them in my .hgignore file?

据我了解,pip沿着名为pip-delete-this-directory.txt的文件在此存储了已下载软件包的源.但是当我删除它时,一切仍然有效,因为实际的代码已放入venv/lib/python2.7/site-packages/中.那么build/的真正目的是什么?

As far as i understand, pip stores source of downloaded packages there along a file called pip-delete-this-directory.txt. But when i delete it, everything still works, as the real code is being put into venv/lib/python2.7/site-packages/. Then what is build/ really for?

推荐答案

build目录是将软件包解包并从中构建的目录.成功安装软件包后,除非您已删除pip-delete-this-directory.txt,否则pip将从build中删除解压缩的目录.如pip-delete-this-directory.txt中所述:

The build directory is where a packages gets unpacked into and build from. When the package is installed successfully, pip removes the unpacked dir from build, unless you've removed pip-delete-this-directory.txt. As described in pip-delete-this-directory.txt:

This file is placed here by pip to indicate the source was put
here by pip.

Once this package is successfully installed this source code will be
deleted (unless you remove this file).

因此,它对于运行时环境不太重要.您可以安全地忽略它.

Thus its less important for runtime environment. You could ignore it safely.

此外,您可以使用pip install -b customized_build_directory将另一个目录指定为build基本目录,例如/tmp

Also, you could use pip install -b customized_build_directory to specify another directory as build base directory, for example /tmp

此外,如果先前安装的软件包失败,则可以pip install --no-download package_name无需下载即可重建该软件包.

Furthermore, you could pip install --no-download package_name to rebuild the package w/o downloading it, if the previous installation of the package failed.

这篇关于点创建构建/目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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