Can't convert from PyPtr to related type
还没有人认领这个 Issue。
评估
调研方向
使用 PyCall.jl、Conda.jl 和 rdflib 复现 macOS Julia 1.9.1 示例。从 PyCall's src/pyfncall.jl:43 和 graph.py 中的 rdflib 断言开始,然后跟踪 URIRef 和 Literal 参数的转换过程。完成标准是 graph.add 调用能够接受创建的 rdflib term,且不会出现断言错误。
由索引模型根据 Issue 内容生成。
描述
Hello everyone and thanks for the great library. I was trying to use rdflib of Python in PyCall.jl. I'm using macos, Julia 1.9.1 and using ENV["Python"]="" with Conda.jl. With this code,
using PyCall
# Create an empty graph
graph = pyimport("rdflib").Graph()
# Define the namespace
ex = "http://example.org/"
# Define the triples
subject = pyimport("rdflib").URIRef(ex * "subject")
predicate = pyimport("rdflib").URIRef(ex * "predicate")
object = pyimport("rdflib").Literal("object")
# Add the triples to the graph
graph.add((subject, predicate, object))
I got the following output
ERROR: PyError ($(Expr(:escape, :(ccall(#= /Users/hiiroo/.julia/packages/PyCall/ilqDX/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'AssertionError'>
AssertionError('Subject http://example.org/subject must be an rdflib term')
File "/Users/hiiroo/.julia/conda/3/lib/python3.7/site-packages/rdflib/graph.py", line 532, in add
assert isinstance(s, Node), "Subject %s must be an rdflib term" % (s,)
- 主要语言
- Julia
- 星标
- 1.5k
- 派生
- 186
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaPy/PyCall.jl 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
Meta-Issue: Mutli-threading leads to segfaults可能已有人在做 @topolarity 于 211 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 20/100
-
Crashes with Julia 1.12 and Revise.jl可能已有人在做 @topolarity 于 211 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 45/100
查看 JuliaPy/PyCall.jl 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
JuliaPhysics/BeamletOptics.jl#127 ·
维护者通常 1 天内回复
-
Chains resumed from `initial_state` take `num_warmup + 1` warm-up steps可能已有人在做 @thevolatilebit 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
TuringLang/AbstractMCMC.jl#220 ·
-
found-by-agent
难度 2/5 1-3 小时 新手友好度 68/100
exanauts/SparseDirectSolver.jl#92 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复