pip install -e 不捕获源代码中的更改

发布于 2025-01-20 23:14:20 字数 416 浏览 0 评论 0原文

我已经用 git 克隆了一个存储库,我想尝试对源代码进行一些更改。为此,我使用 virtualenv 创建一个环境并运行 pip install -e . (其中 . 是源代码中包含的目录setup.py)以可编辑形式安装软件包。

问题:运行包时(激活环境后)不会捕获我对源代码所做的更改。

见解:即使环境对应的 site-packages 目录包含一个带有源代码链接的 .egg-link 文件,我已经意识到它包含源代码的“静态”副本。如果我修改该副本中的代码,则在运行代码时会反映更改。

你知道可能会发生什么吗?这是正常行为吗?感谢您的帮助。

I have cloned a repository with git and I want to try some changes in the source code. For that, I am creating an environment with virtualenv and running pip install -e . (where . is the directory in the source code that contains the setup.py) to install the package in editable form.

Problem: changes I make to the source code are not captured when I run the package (after activating the environment).

Insight: Even if the site-packages directory corresponding to the environment contains a .egg-link file with a link to the source code, I have realized that it contains a "static" copy of the source code. If I modify the code in that copy, the changes are reflected when I run the code.

Do you know what may be happening? Is this the normal behaviour? Thank you for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文