Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Wrong libpython configuration after changing python dir on Linux

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

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
julia, python

研究方向

首先使用 Pkg.build("PyCall") 重現設定,並檢查產生的 deps.jl,以及 PyCall.Conda.libpython 和 PyCall.PYTHONHOME。追蹤 conda 目錄變更後 PyCall.libpython 的選取位置;當它解析到 /opt/conda/3 底下,且可攜式的已編譯應用程式能在另一台機器上執行時,即表示完成。

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

描述

I want to make a portable app with PyCall included, so I move conda into a common folder (this folder I would later copy to another machine when deploying compiled app binaries):

sudo cp -rf ~/.julia/conda /opt/conda

Then I rebuild PyCall and make sure all conda and python-related paths (there are much of them!) point to the right place:

julia -e 'import Pkg; 
ENV["CONDA_JL_HOME"] = "/opt/conda/3"; 
ENV["PYTHON"] = "/opt/conda/3/bin/python3.9"; 
Pkg.add("PyCall"); 
Pkg.build("PyCall");

using PyCall
@info(
           "Conda.jl and PyCall.jl configuration after build, BUT wrong libpython!",
           PyCall.Conda.ROOTENV,
           PyCall.Conda.MINICONDA_VERSION,
           PyCall.Conda.deps_file,
           PyCall.Conda.PREFIX,
           PyCall.Conda.BINDIR,
           PyCall.Conda.LIBDIR,
           PyCall.Conda.SCRIPTDIR,
           PyCall.Conda.PYTHONDIR,
           PyCall.Conda.conda,
           PyCall.Conda.CONDARC,
           PyCall.PYTHONHOME,
           PyCall.libpython
       )
'

Which gives me all paths set right but PyCall.libpython, which prevents me from running my compiled app on another machine: (also, I'm not sure about colons in PyCall.PYTHONHOME)

┌ Info: Conda.jl and PyCall.jl configuration after build, BUT wrong libpython!
│   PyCall.Conda.ROOTENV = "/opt/conda/3"
│   PyCall.Conda.MINICONDA_VERSION = "3"
│   PyCall.Conda.deps_file = "/home/root2/.julia/packages/Conda/x2UxR/src/../deps/deps.jl"
│   PyCall.Conda.PREFIX = "/opt/conda/3"
│   PyCall.Conda.BINDIR = "/opt/conda/3/bin"
│   PyCall.Conda.LIBDIR = "/opt/conda/3/lib"
│   PyCall.Conda.SCRIPTDIR = "/opt/conda/3/bin"
│   PyCall.Conda.PYTHONDIR = "/opt/conda/3/bin"
│   PyCall.Conda.conda = "/opt/conda/3/bin/conda"
│   PyCall.Conda.CONDARC = "/opt/conda/3/condarc-julia.yml"
│   PyCall.PYTHONHOME = "/opt/conda/3:/opt/conda/3"
└   PyCall.libpython = "/home/root2/.julia/conda/3/lib/libpython3.9.so.1.0"

Contents of deps.jl:

$ cat /home/root2/.julia/packages/Conda/x2UxR/src/../deps/deps.jl
const ROOTENV = "/opt/conda/3"
const MINICONDA_VERSION = "3"
const USE_MINIFORGE = true
const CONDA_EXE = "/opt/conda/3/bin/conda"
主要語言
Julia
星號
1.5k
分支
186
平均合併
7 天 10 小時
30 天內合併 PR
2

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

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

JuliaPy/PyCall.jl 的其他 Issue

查看 JuliaPy/PyCall.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

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

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