Skip to content

segfault importing PyCall after importing Julia package with python dependencies / PythonCall.jl #220

Closed
@RoyCCWang

Description

@RoyCCWang

Hi, thanks for developing this package.

Here is my versioninfo():

Julia Version 1.8.1
Commit afb6c60d69a (2022-09-06 15:09 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 × AMD Ryzen 7 1700 Eight-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, znver1)
Threads: 1 on 16 virtual cores
I'm using the official generic Linux binaries on Fedora 36.

The Julia package involved is NMRLoadExperiment.jl

It is a minimal wrapper example for my work that uses PythonCall.jl to manage Python dependencies. NMRLoadExperiment.jl uses the nmrglue Python library, which I included in the CondaPkg.toml file in the repo page.

NMRLoadExperiment.jl on its own works as intended in Julia. I have issues when I load NMRLoadExperiment.jl then anything that uses PyCall.jl. For example, from a clean install of Julia, I did the following since I'm used to using Conda.jl to manage my Python tools:

import Pkg
Pkg.add("PyCall")
ENV["PYTHON"] =""
Pkg.build("PyCall")

Pkg.add(url="https://github.com/AI4DBiological-Systems/NMRLoadExperiment.jl")

If I then do:

import NMRLoadExperiment
import PyCall

or

import PyCall
import NMRLoadExperiment

it would segfault after the second import. Please let me know if you can reproduce this, need the full error report, or if I have done something incorrectly at NMRLoadExperiment.jl

I purposely made it so that NMRLoadExperiment.jl has a more self-contained Python dependency via PythonCall.jl, even though I use Conda.jl with PyCall.jl for development. This is because NMRLoadExperiment.jl is intended for release for public use eventually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions