pip Frozen会像在python索引站点上一样捕获软件包名称,但不是。需要完整的路径 [英] pip freeze captures the package name as if it was on python index site, but it is not. full path is needed
本文介绍了pip Frozen会像在python索引站点上一样捕获软件包名称,但不是。需要完整的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从git hub安装了一个软件包:
I installed a package from 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
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?
推荐答案
我遇到了同样的问题。我相信每当软件包位于子目录(例如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.
--- 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 = 'me@example.com',
-
- packages = find_packages('src'),
- package_dir = {'': 'src'},
-
+ packages = ['macaddress'],
install_requires = ['setuptools'],
requires = ['netaddr'],
#tests_requires = ['django'],
这篇关于pip Frozen会像在python索引站点上一样捕获软件包名称,但不是。需要完整的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文