Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create app with conda dependencies #752

Open
philippwitte opened this issue Jan 4, 2023 · 2 comments
Open

Create app with conda dependencies #752

philippwitte opened this issue Jan 4, 2023 · 2 comments

Comments

@philippwitte
Copy link

philippwitte commented Jan 4, 2023

I'm trying to create a relocatable app that has Python/Conda dependencies. E.g., in the simplest case, I'm creating an app that has PyPlot as the only dependency:

uuid = "60e04576-4d8c-4856-bc57-482afded9445"
authors = ["user"]
version = "0.1.0"

[deps]
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"

The app itself looks like this (i.e. a simplified version of the example from PackageCompiler.jl):

module TestApp

using PyPlot

function julia_main()::Cint
    try
        real_main()
    catch
        Base.invokelatest(Base.display_error, Base.catch_stack())
        return 1
    end
    return 0
end


function real_main()
    @show ARGS
    @show Base.PROGRAM_FILE
    @show DEPOT_PATH
    @show LOAD_PATH
    @show pwd()
    @show Base.active_project()
    @show Sys.BINDIR

    @show Base.JLOptions().opt_level
    @show Base.JLOptions().nthreads
    @show Base.JLOptions().check_bounds

    display(Base.loaded_modules)
    println()

    println("Running a jll package:")

    return
end

end # module

Creating the app with create_app("TestApp", "TestAppCompiled") works as expected and I can run the binary. However, once I zip the compiled app and run it on a different machine, I'm getting a library error:

InitError(mod=:PyCall, error=ErrorException("could not load library "/home/user/.julia/conda/3/lib/libpython3.9.so.1.0"

So, it looks like conda was not included in the app and instead the library file from my local Julia installation is used. Any suggestions on how to address this?

@simonbyrne
Copy link
Collaborator

Can you fix the markdown formatting? It's a bit hard to read (use triple backticks to quote blocks). See https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code

@biona001
Copy link

biona001 commented Aug 24, 2023

I'm having the same issue, except the package I'm using is RCall.jl.
Did you ever figure out what to do here?

Edit: since this seems to be an old issue, I re-posted it on discourse: https://discourse.julialang.org/t/creating-app-with-packagecompiler-jl-how-to-include-r-dependency/103167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants