如何让 `pip install --editable` 运行 sdist 而不是开发?
此 使用存储库中的 pip 或 easy_install 安装 Python 软件包指出了 pip 的一个非常有趣的特性。
然而,有时您只想安装源代码发行版; 时尤其如此
- 当您在 virtualenv 中运行
- (因此您不关心弄乱 python 路径,因为您正在考虑在 env 中执行它),当您不是该特定包的开发人员,并且您不这样做时 不想让它“可编辑”。
- 当您无法 pip install package-name 因为该包不在任何索引中并且
- 没有可用的 tar.gz 时,
感谢您的回答!
This Python package install using pip or easy_install from repos points out a very interesting features of pip.
However, sometimes you just want it to install the source distribution; this is particularly true when
- you are running in a virtualenv (so you don't care about messing up the python path, since you are deliberating doing it in an env),
- when you are not the developer of that particular package, and you don't want to have it "editable",
- when you cannot pip install package-name because the package is not in any index,
- when there is no tar.gz available.
Thanks for your answers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过省略 --editable ?如果我运行,
它将存储库克隆到临时构建目录并正常安装(通过 setup.py install 而不是 setup.pydevelopment)。
当然,如果您随后冻结此环境,则生成的要求将无法满足。如果您需要这个,那么只需使用 --editable (实际上没有太大区别,即使您实际上不需要编辑包也可以正常工作)或者只运行您自己的实例,例如 chishop 并将您需要的 sdists 上传到其中,然后使用 -i 或 --extra-index-url 选项。
Have you tried just omitting the --editable? If I run
it clones the repo to a temporary build directory and installs normally (via setup.py install rather than setup.py develop).
Of course, if you then freeze this environment, the generated requirement will not be fulfillable. If you need this, then just use --editable (there's really not much difference, works fine even if you don't actually need to edit the package) or just run your own instance of something like chishop and upload the sdists you need to it, then use the -i or --extra-index-url option.