clj-python / clj-python/libpython-clj

Failed to load library on Windows (:libnames construction)

未關閉
#140 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Clojure
星號
1.2k
分支
74
PR 合併指標
30 天內沒有已合併 PR

描述

I'm just starting to try to use this amazing project. I'm trying to do everything in windows for project-specific reasons. I could be missing something obvious because I lack experience developing clojure/java/python on windows, but it appears to me that the issue is with https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj/python/interpreter.clj#L86 python-library-regex not actually being used (the one call to it being commented out). I could try hacking it into place and submitting a PR, but I assume there's a good reason it's not currently in there. Please advise!

My bare stub of a project is at https://github.com/momerath42/phil for reproduction's sake. Attached is the debug .edn file, and here is the output at the [power]shell:

PS E:\full melon\phil> clj -X phil.core/-main
2020-12-06T23:19:02.336Z VennstationOne INFO [phil.core:10] - using config file: E:\full melon\phil\config_phil.edn
2020-12-06T23:19:02.373Z VennstationOne INFO [phil.core:27] - Hi, I'm PHIL!
2020-12-06T23:19:02.374Z VennstationOne INFO [phil.core:28] - my current working directory is (maybe): E:\full melon\phil
2020-12-06T23:19:02.374Z VennstationOne INFO [phil.core:29] - I slurped this config: {:listens {:python-executable "c:\\Users\\micha\\anaconda3\\python.exe", :library-path "c:\\Users\\micha\\anaconda3", :windows-anaconda-activate-bat "c:\\Users\\micha\\anaconda3\\condabin\\activate.bat"}}
2020-12-06T23:19:02.376Z VennstationOne INFO [phil.listens:10] - listens/start-listening cfg: {:python-executable "c:\\Users\\micha\\anaconda3\\python.exe", :library-path "c:\\Users\\micha\\anaconda3", :windows-anaconda-activate-bat "c:\\Users\\micha\\anaconda3\\condabin\\activate.bat"}
Dec 06, 2020 3:19:02 PM clojure.tools.logging$eval4632$fn__4635 invoke
INFO: Executing python initialize with options:{:python-executable "c:\\Users\\micha\\anaconda3\\python.exe", :program-name nil, :python-home nil, :library-path "c:\\Users\\micha\\anaconda3"}
Dec 06, 2020 3:19:02 PM clojure.tools.logging$eval4632$fn__4635 invoke
INFO: Detecting startup-info for Python executable: c:\Users\micha\anaconda3\python.exe
Dec 06, 2020 3:19:02 PM clojure.tools.logging$eval4632$fn__4635 invoke
INFO: Startup info detected:
{:lib-version "3.8",
 :java-library-path-addendum "c:\\Users\\micha\\anaconda3\\lib",
 :exec-prefix "c:\\Users\\micha\\anaconda3",
 :executable "c:\\Users\\micha\\anaconda3\\python.exe",
 :libnames ("c:\\Users\\micha\\anaconda3" "python3.8"),
 :prefix "c:\\Users\\micha\\anaconda3",
 :base-prefix "c:\\Users\\micha\\anaconda3",
 :base-exec-prefix "c:\\Users\\micha\\anaconda3",
 :python-home "c:\\Users\\micha\\anaconda3",
 :version [3 8 5],
 :platform "win32"}

Dec 06, 2020 3:19:02 PM clojure.tools.logging$eval4632$fn__4635 invoke
INFO: Trying python library names ["c:\\Users\\micha\\anaconda3" "c:\\Users\\micha\\anaconda3" "python3.8" "python3.7m" "python3.6m"]
Dec 06, 2020 3:19:02 PM clojure.tools.logging$eval4632$fn__4635 invoke
INFO: Setting java library path: c:\Users\micha\anaconda3\lib:C:\Users\micha\scoop\apps\adoptopenjdk-lts-hotspot\current\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Users\micha\scoop\apps\adoptopenjdk-lts-hotspot\current\bin;C:\Users\micha\scoop\shims;C:\Program Files\Oculus\Support\oculus-runtime;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\GTK2-Runtime\bin;C:\Program Files (x86)\ZED SDK\dependencies\freeglut_2.8\x64;C:\Program Files (x86)\ZED SDK\dependencies\glew-1.12.0\x64;C:\Program Files (x86)\ZED SDK\dependencies\opencv_3.1.0\x64\vc14\bin;C:\Program Files (x86)\ZED SDK\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%SYSTEMROOT%\System32\OpenSSH\;C:\Users\micha\AppData\Local\Microsoft\WindowsApps;C:\Users\micha\AppData\Local\GitHubDesktop\bin;C:\Users\micha\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Imaginando\UBRIDGE;C:\Users\micha\AppData\Local\Programs\Microsoft VS Code\bin;.
Dec 06, 2020 3:19:02 PM clojure.tools.logging$eval4632$fn__4635 invoke
INFO: Reference thread starting
Execution error (ExceptionInfo) at tech.v3.jna.base/do-load-library (base.clj:157).
Failed to load library

Full report at:
C:\Users\micha\AppData\Local\Temp\clojure-15358896831604690969.edn

libpython-load-fail-edn.txt

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 src/libpython_clj/python/interpreter.clj 中提到 python-library-regex 的第 86 行附近開始,使用顯示的 Windows 命令和附帶的除錯 EDN 在 phil project 中重現該問題。追蹤產生的 :libnames 和程式庫載入失敗。完成標準是 Python 能在 Windows 上成功初始化,且不出現 Failed to load library 錯誤。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
clojure, python
領域
backend, operating-systems
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。