簡體   English   中英

找不到模塊“...Python38\lib\site-packages\lightgbm\lib_lightgbm.dll”

[英]Could not find module “…Python38\lib\site-packages\lightgbm\lib_lightgbm.dll”

我正在嘗試為 Python 安裝 LightGBM GPU 構建。 我從 Git 安裝並成功構建 LightGBM,測試運行結果如預期。

[LightGBM] [Info] Iteration:100, training auc : 0.997687
[LightGBM] [Info] Iteration:100, valid_1 binary_logloss : 0.519711
[LightGBM] [Info] Iteration:100, valid_1 auc : 0.81798
[LightGBM] [Info] 14.887669 seconds elapsed, finished iteration 100
[LightGBM] [Info] Finished training

然而,當我試圖

import LightGBM as gbm

Python 返回

FileNotFoundError: Could not find module 'C:\Users\N\AppData\Local\Programs\Python\Python38\lib\site-packages\lightgbm\lib_lightgbm.dll'. Try using the full path with constructor syntax.

我試過運行setup.py install --precompile ,但沒有幫助。 我在這個過程中錯過了什么嗎?

從 Python 3.8 開始。dll 搜索方法已更改。 文檔供參考。 嘗試os.chdir('path_to_working_dlls_directoy')或者如果這不起作用嘗試os.add_dll_directory("path_to_working_dlls_directoy")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM