You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装compress-fasttext[full]遇pqkmeans相关lshash3编译错误求助

问题描述

尝试安装compress-fasttext库的full版本时,执行命令:

pip install compress-fasttext[full]

在Ubuntu 18.0系统下的Python 3.7、3.8版本中遇到以下错误:

running install_egg_info
Copying lshash3.egg-info to build/bdist.linux-x86_64/wheel/lshash3-0.0.8-py3.8.egg-info
running install_scripts
error: invalid command 'bdist_wininst'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lshash3

已尝试Python 2.7版本:可成功安装pqkmeans,但compress-fasttext无法正常工作;Python 3.7、3.8均出现上述相同错误,且已在项目仓库提交相关Issue。

解决线索
  • 升级pip、setuptools和wheel到最新版本,旧版本工具可能存在兼容性问题:
    pip install --upgrade pip setuptools wheel
    
  • 跳过lshash3的wheel构建,直接从源码安装:
    pip install lshash3 --no-binary :all:
    
    安装完成后再执行pip install compress-fasttext[full],此时会跳过已安装的lshash3。
  • 手动修改lshash3的源码后本地安装:
    1. 获取lshash3的源码仓库并克隆到本地
    2. 打开仓库中的setup.py文件,删除所有涉及bdist_wininst的代码(该命令为Windows平台专属,Linux环境无需支持)
    3. 进入源码目录执行pip install .完成安装,之后再安装compress-fasttext[full]
  • 先安装compress-fasttext基础版本,再手动补充依赖:
    pip install compress-fasttext
    
    之后根据compress-fasttext[full]的依赖列表,逐个安装除lshash3外的其他依赖,最后用上述方法单独安装lshash3。

内容的提问来源于stack exchange,提问作者Hossam Amer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 02:51:08