Skip to content

Why must both PYTHON_JULIACALL_PROJECT and PYTHON_JULIACALL_EXE be set together? #675

Description

@oxinabox

I wanted to set my PYTHON_JULIACALL_PROJECT manually because i wanted to manage my julia dependencies manually, so i could use them both in julia (for testing) and via juliacall.
And because i didn't want them to be in my conda directory as that doesn't get version controlled and i wanted the manifest to get version controlled

But I didn't want to set my PYTHON_JULIACALL_EXE because I do not know where julia wil be installed on any of my collaborators machines and am happy to let them be worked out by juliapkg.

But i tried this and then got an error on import juliacall

Exception: Both PYTHON_JULIACALL_PROJECT and PYTHON_JULIACALL_EXE must be set together, not only one of them.

Activity

  1. cjdoris commented on Sep 19, 2025

    @cjdoris
    Member

    It's because if you have created and instantiated a Julia project (JuliaCall requires the project to be instantiated) then you already have a Julia executable to do that - in which case you should use the same Julia in JuliaCall.

    Maybe set PYTHON_JULIAPKG_PROJECT instead? This will still use juliapkg for dependency management.

    Or set PYTHON_JULIAPKG_EXE=julia assuming they already have julia in their PATH.

  2. oxinabox commented on Sep 19, 2025

    @oxinabox
    ContributorAuthor

    JuliaCall requires the project to be instantiated

    That's annoying.
    I just want to manage my Manifest.toml and Project.toml myself and version control those.
    I don't want to have to instantiate them manually.
    As well has have access to that location being implictly on my JULIA_LOAD_PATH (though right now I am doing that manually)

    Maybe set PYTHON_JULIAPKG_PROJECT instead? This will still use juliapkg for dependency management.

    This doesn't seem to be anywhere in the docs, what does it do?

  3. cjdoris commented on Sep 19, 2025

    @cjdoris
    Member

    That's annoying.

    That's just how Julia works - if someone gives you a Project.toml and a Manifest.toml, you have to instantiate it first. JuliaCall intentionally doesn't touch Pkg itself, that is delegated to JuliaPkg. So if you want it automatically instantiated you need to stick with JuliaPkg.

    This doesn't seem to be anywhere in the docs, what does it do?

    It's here in the JuliaPkg docs although yeah it should also get covered in the JuliaCall docs. It lets you specify where the Julia project is that JuliaPkg installs things into. On JuliaPkg v0.1.20+, if it's a pre-existing project then it will leave existing dependencies alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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