(venv) PS D:\PycharmProjects\langChainLearn> pip install llama-cpp-python
Collecting llama-cpp-python
  Using cached llama_cpp_python-0.2.6.tar.gz (1.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: typing-extensions>=4.5.0 in d:\pycharmprojects\langchainlearn\venv\lib\site-packages (from llama-cpp-python) (4.7.1)
Requirement already satisfied: numpy>=1.20.0 in d:\pycharmprojects\langchainlearn\venv\lib\site-packages (from llama-cpp-python) (1.25.2)
Collecting diskcache>=5.6.1 (from llama-cpp-python)
  Obtaining dependency information for diskcache>=5.6.1 from
  Using cached diskcache-5.6.3-py3-none-any.whl.metadata (20 kB)
Using cached diskcache-5.6.3-py3-none-any.whl (45 kB)
Building wheels for collected packages: llama-cpp-python
  Building wheel for llama-cpp-python (pyproject.toml) ... error
  error: subprocess-exited-with-error                                             
  × Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
  │ exit code: 1                                                                  
  ╰─> [20 lines of output]
      *** scikit-build-core 0.5.0 using CMake 3.27.5 (wheel)
      *** Configuring CMake...
      2023-09-18 16:59:04,497 - scikit_build_core - WARNING - Can't find a Python library, got libdir=None, ldlibrary=None, multiarch=None, masd=No
      loading initial cache file C:\Users\z00498ta\AppData\Local\Temp\tmpgz_51jr8\build\CMakeInit.txt
      -- Building for: NMake Makefiles
      CMake Error at CMakeLists.txt:3 (project):
         'nmake' '-?'
        failed with:
         The system cannot find the file specified
      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
      CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
      -- Configuring incomplete, errors occurred!
      *** CMake configuration failed
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for llama-cpp-python
Failed to build llama-cpp-python
ERROR: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects
(venv) PS D:\PycharmProjects\langChainLearn> 
(venv) PS D:\PycharmProjects\langChainLearn> 

先尝试下了个CMaker 3.27.5 在windows机器安装了 (看见上面的日志里提的是这个版本)Download | CMake
但 好像是有些变量要设置,但是现在不清楚改怎么设置。

1 Like

conda install -c conda-forge c-compiler
conda install -c "conda-forge/label/cf202003" c-compiler


conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling 
of the name, or if a path was included, verify that the path is correct and try again.   
At line:1 char:1                                                                         
+ conda active venv                                                                      
+ ~~~~~                                                                                  
    + CategoryInfo          : ObjectNotFound: (conda:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException                                   

如果手动安装conda 是不是比较麻烦?



我没有anaconda的环境 看错误应该不涉及这个

根据下面的连接 现在准备 新装个VisualStudio 2022 + C++ building tool再重新安装试试

 Building windows wheels for Python 3.10 requires Microsoft Visual Studio 2022.


嗯 那就好 我还在下载 :smile:

结贴!按上面的方式 重启机器后 安装上可以 运行

1 Like