在Windows11上安装句子转换器(使用最新版本的Python和pip)时出现以下错误.有没有人能帮个忙?查看了许多其他类似的帖子,但这些解决方案都不起作用.
C:\Users\abc\ai\llama\jupyterproj\stlit>py -m pip install sentence-transformers
Collecting sentence-transformers
Using cached sentence_transformers-2.3.1-py3-none-any.whl.metadata (11 kB)
Collecting transformers<5.0.0,>=4.32.0 (from sentence-transformers)
Using cached transformers-4.37.2-py3-none-any.whl.metadata (129 kB)
Requirement already satisfied: tqdm in c:\users\abc\appdata\local\programs\python\python312\lib\site-packages (from sentence-transformers) (4.66.2)
Requirement already satisfied: torch>=1.11.0 in c:\users\abc\appdata\local\programs\python\python312\lib\site-packages (from sentence-transformers) (2.2.0)
Requirement already satisfied: numpy in c:\users\abc\appdata\local\programs\python\python312\lib\site-packages (from sentence-transformers) (1.26.4)
Collecting scikit-learn (from sentence-transformers)
Using cached scikit_learn-1.4.0-1-cp312-cp312-win_amd64.whl.metadata (11 kB)
Collecting scipy (from sentence-transformers)
Using cached scipy-1.12.0-cp312-cp312-win_amd64.whl.metadata (60 kB)
Collecting nltk (from sentence-transformers)
Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
Collecting sentencepiece (from sentence-transformers)
Using cached sentencepiece-0.1.99.tar.gz (2.6 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\abc\AppData\Local\Temp\pip-install-3n9shirh\sentencepiece_fc383392079e43b6a8c226f0484c0928\setup.py", line 126, in <module>
subprocess.check_call([
File "C:\Users\abc\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 408, in check_call
retcode = call(*popenargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abc\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 389, in call
with Popen(*popenargs, **kwargs) as p:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\abc\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\abc\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
[end of output]
注意:这个错误来自一个子进程,可能不是pip的问题. 错误:元数据生成失败
*生成程序包元数据时遇到错误. ╰─>;的输出见上文.
注意:这是上面提到的包的问题,而不是pip. 提示:有关详细信息,请参阅上文.