ERROR: Failed building wheel for sentence-transformers

楚浩然
2023-12-01

项目场景:

安装包是报错 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
 类似资料:

相关阅读

相关文章

相关问答