pip freeze 捕获包名称,就好像它位于 python 索引站点上一样,但事实并非如此。需要完整路径

发布于 2024-11-19 18:04:56 字数 411 浏览 3 评论 0原文

我从 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 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

焚却相思 2024-11-26 18:04:57

我有同样的问题。我相信只要包位于子目录(例如 src)中,这就是一个问题。这是为我修复它的补丁

--- a/setup.py
+++ b/setup.py
@@ -11,13 +11,9 @@ setup(
     license = 'BSD',
     description = "MAC address model and form fields for Django apps.",
     long_description = read('README.rst'),
-
     author = 'Ryan Nowakowski',
     author_email = '[email protected]',
-
-    packages = find_packages('src'),
-    package_dir = {'': 'src'},
-    
+    packages = ['macaddress'],
     install_requires = ['setuptools'],
     requires = ['netaddr'],
     #tests_requires = ['django'],

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.

--- a/setup.py
+++ b/setup.py
@@ -11,13 +11,9 @@ setup(
     license = 'BSD',
     description = "MAC address model and form fields for Django apps.",
     long_description = read('README.rst'),
-
     author = 'Ryan Nowakowski',
     author_email = '[email protected]',
-
-    packages = find_packages('src'),
-    package_dir = {'': 'src'},
-    
+    packages = ['macaddress'],
     install_requires = ['setuptools'],
     requires = ['netaddr'],
     #tests_requires = ['django'],
花开雨落又逢春i 2024-11-26 18:04:57

我修复了它,不知道如何,但我必须更改 setup.py

pip install -e git+http://github.com/un33k/django-uuslug.git#egg=django-uuslug

如果您发现类似问题,并且发现自己在这个问题上,只需查看上面包中的 setup.py 即可。也许你可以告诉我我是如何修复它的。我只是稍微移动了一些东西。

I fixed it, don't know how, but I had to change the setup.py

pip install -e git+http://github.com/un33k/django-uuslug.git#egg=django-uuslug

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文