X-D-Lab / LangChain-ChatGLM-Webui

基于LangChain和ChatGLM-6B等系列LLM的针对本地知识库的自动问答
Apache License 2.0
3.14k stars 474 forks source link

win10下安装detectron2一直失败 #63

Closed ccartermices closed 1 year ago

ccartermices commented 1 year ago

安装requirement的时候出错,以下是主要信息: ... Building wheels for collected packages: unstructured-inference, sentence-transformers, detectron2, langchain-serve, jina, docarray, fvcore, antlr4-python3-runtime, jcloud, promise, pycocotools, future, python-docx, python-pptx, olefile Building wheel for unstructured-inference (setup.py) ... done Created wheel for unstructured-inference: filename=unstructured_inference-0.4.4-py3-none-any.whl size=36816 sha256=fd37dd8b1c4723d1206d7c4757dbe285f02cf4119396d0c72f43c935a0ea3e1b Stored in directory: e:\pipcache\wheels\7f\0c\91\360ebd8b96f0acd20be6cf329c372911a4c01c05c16a8846d3 Building wheel for sentence-transformers (setup.py) ... done Created wheel for sentence-transformers: filename=sentence_transformers-2.2.2-py3-none-any.whl size=125960 sha256=98195ec8c6a418f5085171098d4fa5bd7b2fb0c3e06e0105138b21f09a6aaeca Stored in directory: e:\pipcache\wheels\71\67\06\162a3760c40d74dd40bc855d527008d26341c2b0ecf3e8e11f Building wheel for detectron2 (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [1042 lines of output] running bdist_wheel E:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\utils\cpp_extension.py:476: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) running build running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\detectron2 copying detectron2__init__.py -> build\lib.win-amd64-cpython-39\detectron2 creating build\lib.win-amd64-cpython-39\tools copying tools\analyze_model.py -> build\lib.win-amd64-cpython-39\tools copying tools\benchmark.py -> build\lib.win-amd64-cpython-39\tools copying tools\convert-torchvision-to-d2.py -> build\lib.win-amd64-cpython-39\tools copying tools\lazyconfig_train_net.py -> build\lib.win-amd64-cpython-39\tools copying tools\lightning_train_net.py -> build\lib.win-amd64-cpython-39\tools copying tools\plain_train_net.py -> build\lib.win-amd64-cpython-39\tools copying tools\train_net.py -> build\lib.win-amd64-cpython-39\tools copying tools\visualize_data.py -> build\lib.win-amd64-cpython-39\tools copying tools\visualize_json_results.py -> build\lib.win-amd64-cpython-39\tools copying tools__init__.py -> build\lib.win-amd64-cpython-39\tools ... "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe" /c logo /O2 /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IC:\Users\cc\AppData\Local\Temp\pip-install-2wjkw3vm\detectron2_1187d9a69c984854be83cbda608f18ff\detectron2\layers\csrc -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\torch\csrc\api\include -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\TH -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\include -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /EHsc /TpC:\Users\cc\AppData\Local\Temp\pip-install-2wjkw3vm\detectron2_1187d9a69c984854be83cbda608f18ff\detectron2\layers\csrc\ROIAlignRotated\ROIAlignRotated_cpu.cpp /Fobuild\temp.win-amd64-cpython-39\Release\Users\cc\AppData\Local\Temp\pip-install-2wjkw3vm\detectron2_1187d9a69c984854be83cbda608f18ff\detectron2\layers\csrc\ROIAlignRotated\ROIAlignRotated_cpu.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 ROIAlignRotated_cpu.cpp E:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\c10/macros/Macros.h(138): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 E:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\c10/util/Optional.h(212): warning C4624: “c10::constexpr_storage_t”: 已将析构函数隐式定义为“已删除” with [ T=c10::SymInt ] E:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\c10/util/Optional.h(411): note: 查看对正在编译的 类 模板 实例化“c10::constexpr_storage_t”的引用 with [ T=c10::SymInt ] ... 晓媮 18:09:58 "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe" /c logo /O2 /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IC:\Users\cc\AppData\Local\Temp\pip-install-2wjkw3vm\detectron2_1187d9a69c984854be83cbda608f18ff\detectron2\layers\csrc -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\torch\csrc\api\include -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\TH -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\include -IE:\minconda_extra_env_folder\langchain-chatGLM-webui\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /EHsc /TpC:\Users\cc\AppData\Local\Temp\pip-install-2wjkw3vm\detectron2_1187d9a69c984854be83cbda608f18ff\detectron2\layers\csrc\ROIAlignRotated\ROIAlignRotated_cpu.cpp /Fobuild\temp.win-amd64-cpython-39\Release\Users\cc\AppData\Local\Temp\pip-install-2wjkw3vm\detectron2_1187d9a69c984854be83cbda608f18ff\detectron2\layers\csrc\ROIAlignRotated\ROIAlignRotated_cpu.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 ROIAlignRotated_cpu.cpp E:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\c10/macros/Macros.h(138): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 E:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\c10/util/Optional.h(212): warning C4624: “c10::constexpr_storage_t”: 已将析构函数隐式定义为“已删除” with [ T=c10::SymInt ] E:\minconda_extra_env_folder\langchain-chatGLM-webui\lib\site-packages\torch\include\c10/util/Optional.h(411): note: 查看对正在编译的 类 模板 实例化“c10::constexpr_storage_t”的引用 with [ T=c10::SymInt ]

晓媮 18:10:34 C:\Users\cc\AppData\Local\Temp\pip-install-2wjkw3vm\detectron2_1187d9a69c984854be83cbda608f18ff\detectron2\layers\csrc\ROIAlignRotated\ROIAlignRotated_cpu.cpp : fatal error C1083: 无法打开编译器生成的文件: “”: Invalid argument error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> detectron2

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

mlwei1 commented 1 year ago

我也一样

thomas-yanxin commented 1 year ago

我也一样

detectron2在windows下的安装请自行搜索相关解决方案。不涉及.pdf格式可以不用安装。