Error due to libpython issuses

未关闭
#505 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
julia, python
领域
api, backend

调研方向

从 julia/core.py 中的 traceback 开始,重点检查 Julia 构造函数及其 UnsupportedPythonError 检查。重现 from julia import Base 的失败,并将其与链接的 troubleshooting 页面中记录的 compiled_modules=False 和 python-jl 解决方法进行比较。完成标准是:已确认所报告的 Python/libpython 设置存在解决方案,或已清楚记录其限制,其中包括是否可以导入 diffeqpy。

由索引模型根据 Issue 内容生成。

描述

Hi, this might be an overlapping issue from previous ones but since I couldn't find a way to solve it, I'm leaving it here.

When I'm trying to import Base, it shows the issue below. I am trying to use another python-julia package diffeqpy and I can not use it also because of this issue.

I tried the "workaround" suggested on the page and seemed nothing really helped much.

Any kind of comments would be very helpful.

>>> from julia import Base
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "/Users/juanko/miniconda3/envs/node/lib/python3.9/site-packages/julia/core.py", line 248, in load_module
    elif self.julia.isafunction(juliapath):
  File "/Users/juanko/miniconda3/envs/node/lib/python3.9/site-packages/julia/core.py", line 239, in julia
    self.__class__.julia = julia = Julia()
  File "/Users/juanko/miniconda3/envs/node/lib/python3.9/site-packages/julia/core.py", line 483, in __init__
    raise UnsupportedPythonError(jlinfo)
julia.core.UnsupportedPythonError: It seems your Julia and PyJulia setup are not supported.

Julia executable:
    julia
Python interpreter and libpython used by PyCall.jl:
    /Users/juanko/miniconda3/envs/node/bin/python3
    /Users/juanko/miniconda3/envs/node/lib/libpython3.9.dylib
Python interpreter used to import PyJulia and its libpython.
    /Users/juanko/miniconda3/envs/node/bin/python3
    /Users/juanko/miniconda3/envs/node/lib/libpython3.9.dylib

Your Python interpreter "/Users/juanko/miniconda3/envs/node/bin/python3"
is statically linked to libpython.  Currently, PyJulia does not fully
support such Python interpreter.

The easiest workaround is to pass `compiled_modules=False` to `Julia`
constructor.  To do so, first *reboot* your Python REPL (if this happened
inside an interactive session) and then evaluate:

    >>> from julia.api import Julia
    >>> jl = Julia(compiled_modules=False)

Another workaround is to run your Python script with `python-jl`
command bundled in PyJulia.  You can simply do:

    $ python-jl PATH/TO/YOUR/SCRIPT.py

See `python-jl --help` for more information.

For more information, see:

    https://pyjulia.readthedocs.io/en/latest/troubleshooting.html

Thanks

主要语言
Python
星标
893
派生
101
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaPy/pyjulia 的其他 Issue

查看 JuliaPy/pyjulia 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。