pip freeze 捕获包名称,就好像它位于 python 索引站点上一样,但事实并非如此。需要完整路径
我从 git hub 安装了一个包:
pip install -e git+http://github.com/un33k/django-uuslug.git#egg=django-uuslug
然后我做了:
pip freeze > req.txt
我得到:
django-uuslug==0.1
现在,如果我执行 pip install -r req.txt
,我会收到 package not found
错误,这是因为 django-uuslug 不在 pypi 上。
为什么 freeze 不记得安装过程中给出的完整路径?
I installed a package from git hub:
pip install -e git+http://github.com/un33k/django-uuslug.git#egg=django-uuslug
Then I did:
pip freeze > req.txt
I get:
django-uuslug==0.1
Now if I do a pip install -r req.txt
, I get a package not found
error, which due to the fact that django-uuslug is not on pypi.
Why is freeze not remembering the full path as it was given during the install?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有同样的问题。我相信只要包位于子目录(例如 src)中,这就是一个问题。这是为我修复它的补丁。
I had the same issue. I believe it's a problem whenever the packages are in a subdirectory(e.g. src). Here's the patch that fixed it for me.
我修复了它,不知道如何,但我必须更改 setup.py
如果您发现类似问题,并且发现自己在这个问题上,只需查看上面包中的 setup.py 即可。也许你可以告诉我我是如何修复它的。我只是稍微移动了一些东西。
I fixed it, don't know how, but I had to change the setup.py
If you find similar issue, and find yourself on this question, just look at the setup.py in the above package. Perhaps you can tell me how I fixed it. I just moved things around a bit.