Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Solved] Windows 上 chatglm_cpp 模块 "DLL load failed while importing _C" 问题 #297

Open
LTHPKBTE opened this issue May 9, 2024 · 2 comments

Comments

@LTHPKBTE
Copy link

LTHPKBTE commented May 9, 2024

由于想要使用 cuda 加速,我添加了对应环境变量 ”CMAKE_ARGS“=“-DGGML_CUBLAS=ON” 后使用 pip install git+https://github.com/li-plus/chatglm.cpp.git@main 命令安装并编译。
然后尝试运行命令 streamlit run .\chatglm.cpp\examples\chatglm3_demo.py 报错如下:

2024-05-09 11:46:26.304 Uncaught app exception
Traceback (most recent call last):
  File "E:\python\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 600, in _run_script
    exec(code, module.__dict__)
  File "E:\ChatGLM3\chatglm.cpp\examples\chatglm3_demo.py", line 14, in <module>
    import chatglm_cpp
  File "E:\python\Lib\site-packages\chatglm_cpp\__init__.py", line 6, in <module>
    import chatglm_cpp._C as _C
ImportError: DLL load failed while importing _C: 找不到指定的模块。

我的 Python 版本为:Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
在 E:\python\Lib\site-packages\chatglm_cpp 文件夹下可以找到 _C.cp311-win_amd64.pyd 文件。
应该如何继续排查问题?我上网搜索后并没有比较有效的信息。谢谢。

@Fros1er
Copy link

Fros1er commented May 14, 2024

#181

@LTHPKBTE LTHPKBTE changed the title [help request] 关于使用 Python 运行 chatglm_cpp 模块的一些问题 [Solved] Windows 上 chatglm_cpp 模块 "DLL load failed while importing _C" 问题 May 14, 2024
@LTHPKBTE
Copy link
Author

#181

谢谢,但由于需要外部操作才能修复这个问题,这个 issue 我暂时留在这里供其他人参考。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants