INSTALLED_APPS 中的 Haystack 导致错误:无法导入名称 openProc
我现在很困难。我有一个 Django 项目,在我尝试添加 Haystack/Whoosh 进行搜索之前,该项目一直运行良好。我在其他项目中也有同样的堆栈,运行良好。
每当我的 settings.INSTALLED_APPS 中有“haystack”并且我尝试 manage.py runserver
或 manage.py shell
时,我会收到“错误:无法导入名称 openProc”
我认为这可能是 Haystack 的依赖项没有正确安装,所以我从站点包中删除了 Haystack 并重新安装,但同样的事情不断发生。谷歌搜索 openProc 和相关关键字没有发现任何结果。
我希望其他人也遇到过这个错误,或者至少现在谷歌中可能会有答案!我知道这些 cannot import name
错误可能很棘手,但这个错误让我特别难受,因为它与外部包相关。
I am pretty stuck right now. I have a Django project that's been working great until I tried to add Haystack/Whoosh for search. I've had this same stack in other projects working fine.
Whenever I have "haystack" in my settings.INSTALLED_APPS and I try manage.py runserver
or manage.py shell
I get 'Error: cannot import name openProc'
I thought that this might be a dependency of Haystack that didn't get installed correctly, so I removed Haystack from site-packages and reinstalled, but the same thing keeps happening. Googling openProc and related keywords has turned up nothing.
I'm hoping that someone else has run into this error, or at least that now there will be something in Google that might have an answer! I know these cannot import name <something>
errors can be tricky, but this one has me especially stumped because it's related to an external package.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
事实证明,我可以通过使用
pip install git+git://github.com/toastdriven/django-haystack.git
安装最新的源代码来使其工作,我的版本有问题开始做
pip install haystack
It turns out I was able to get it working by installing the latest source code using
pip install git+git://github.com/toastdriven/django-haystack.git
Something was wrong with the version I got doing
pip install haystack
我安装了错误版本的 Haystack。必须:
I had wrong versions of Haystack installed. Had to:
我运行了
pip install haystack
并得到了这个错误,然后我运行了pip install django-haystack
问题解决了!I had ran
pip install haystack
and got this error, then I ranpip install django-haystack
problem solved!我也遇到了这个问题,并注意到这是因为我在 settings.py 中有旧的配置变量 - 即 HAYSTACK_SITECONF。一旦删除,错误就消失了。
I had this issue as well, and noticed it was because I had the old config vars in settings.py - namely HAYSTACK_SITECONF. Once it was removed, the error went away.
使用
pip install haystack==0.10
安装过去的版本对我来说很有效,但我想当我有时间时我会尝试迁移到 Haystack 2.0。Installing a past version with
pip install haystack==0.10
worked for me, but I think when I have time I'm going to try to migrate to Haystack 2.0.