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('"'"'\r\n'"'"', '"'"'\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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

singi2015

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值