Skip to main content
 首页 » 编程设计

python之无法安装 whoosh alchemy

2024年11月01日11java哥

我似乎一辈子都无法安装 whoosh alchemy。引用:http://pythonhosted.org/Flask-WhooshAlchemy/ .不管怎样,我在关注http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world在我尝试安装 whoosh-alchemy 的部分。

我正在输入这 3 个中的任何一个

flask\Scripts\pip install flask-whooshalchemy==0.55a  
flask\Scripts\pip install flask-whooshalchemy 
flask\Scripts\pip install flask-whooshalchemy==0.55 

我得到的错误如下:

Downloading/unpacking flask-whooshalchemy 
    Downloading Flask-WhooshAlchemy-0.55.tar.gz 
    Running setup.py (path:C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py) egg_info for package flask-whooshalchemy 
Traceback (most recent call last): 
  File "<string>", line 17, in <module> 
  File "C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py", line 28, in <module> 
    'requirements.txt')).xreadlines()], 
AttributeError: '_io.TextIOWrapper' object has no attribute 'xreadlines' 
Complete output from command python setup.py egg_info: 
Traceback (most recent call last): 
 
File "<string>", line 17, in <module> 
 
 File "C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py", line 28, in <module> 
 
'requirements.txt')).xreadlines()], 
 
 AttributeError: '_io.TextIOWrapper' object has no attribute 'xreadlines' 

我完全不知道如何解决这个问题......我正在尝试用谷歌搜索这个但没有找到任何运气。也许我的 google-fu 太糟糕了。非常感谢任何帮助。

请您参考如下方法:

我找到了 this pull request在 Flask-WhooshAlchemy 的 github 上,它讨论了由于 xreadlines 调用而导致的 pip 安装失败,就像在您的错误日志中一样。尝试直接从已合并该拉取请求的 github 安装它。

这是执行此操作的命令 - pip install git+https://github.com/gyllstromk/Flask-WhooshAlchemy.git