栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

ERROR: Failed building wheel for sentence-transformers

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ERROR: Failed building wheel for sentence-transformers

项目场景:

安装包是报错 ERROR: Failed building wheel for sentence-transformers

安装步骤

sudo python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

问题描述
Building wheels for collected packages: sentence-transformers
  Building wheel for sentence-transformers (setup.py) ... error

 ERROR: Command errored out with exit status 1:
   command: /home/ubuntu/pythonProjects/ai.ueth.org_20220617010122_bc8c7103/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ycpl2xhv/sentence-transformers/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ycpl2xhv/sentence-transformers/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-zw231z_z
       cwd: /tmp/pip-install-ycpl2xhv/sentence-transformers/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for sentence-transformers

  Running setup.py clean for sentence-transformers
Failed to build sentence-transformers
Installing collected packages: certifi, charset-normalizer, click, colorama, filelock, zipp, importlib-metadata, MarkupSafe, Jinja2, itsdangerous, Werkzeug, Flask, PyYAML, typing-extensions, idna, urllib3, requests, pyparsing, packaging, tqdm, huggingface-hub, joblib, regex, nltk, numpy, Pillow, python-dotenv, threadpoolctl, scipy, scikit-learn, sentencepiece, torch, torchvision, tokenizers, transformers, sentence-transformers, waitress
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/ubuntu/pythonProjects/ai.ueth.org_20220617010122_bc8c7103/venv/lib/python3.8/site-packages/certifi-2022.5.18.1.dist-info'
Consider using the `--user` option or check the permissions.

进行的尝试 pip install wheel
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/ubuntu/pythonProjects/ai.ueth.org_20220617020216_2c848b36/venv/lib/python3.8/site-packages/wheel'
Consider using the `--user` option or check the permissions.
pip install wheel --user
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
原因分析:

应该是使用的pip不对导致的


解决方案:
sudo python3 -m pip install -r requirements.txt
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/977536.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号