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 摘要。