我有一个以前安装到可编辑软件包中的环境:
virtualenv venv
. venv/bin/activate
pip install -e ...
pip freeze | grep <pkg_name>
-e git+ssh://
我的问题是 - 如何使其拉出代码以构建和安装,而不是来自远程服务器,而是从我的本地项目中(就像运行 pip install -e
)
显然,假设项目仍然存在,但这是我想要的...
I have an environment which I previously installed into an editable package:
virtualenv venv
. venv/bin/activate
pip install -e ...
pip freeze | grep <pkg_name>
-e git+ssh://[email protected]/SPACE/REPO.git@HASH#egg=NAME&subdirectory=PATH
I copeid the pip freeze
result to a req.txt
file and installed it into a new environment, and it works.
My question is - how can I make it pull the code to build and install, not from a remote server, but from my local project (like done when running pip install -e
)
It would obviously only work on my machine, assuming that project still is there, but this is what I want...
发布评论
评论(2)
根据pip文档( 1 , 2 ),是的,您可以在此中具有这样的条目您的需求.txt:
另外AS chepner 已经指出,一个人只能指定本地URL:
According to pip documentation (1, 2), yes, you can have an entry like this in your requirements.txt:
Also as chepner has pointed out, one could just specify local URL:
以可编辑模式安装软件包时,本地文件系统
相对本地文件路径可以方便。
因此,代替
unignts.txt
:使用
sumpllies.txt
:现在您可以为多个用户和CI环境使用相同的
sublices.txt
。conda,
您也可以在
conda
环境中安装可编辑的Python软件包,并使用envrioment.yml
这样:Local filesystem
Relative local file paths can be handy when installing packages in editable mode.
So instead of
requirements.txt
:Use
requirements.txt
:Now you can use the same
requirements.txt
for multiple users and ci environments.Conda
You can install editable Python packages in
conda
environments too, with aenvrioment.yml
like this: