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

Unresolved envs in LOAD_PATH prevent PythonCall from being loaded #163

Open
MichaelHatherly opened this issue Feb 18, 2025 · 1 comment
Open

Comments

@MichaelHatherly
Copy link

If there are any environments in the LOAD_PATH that haven't yet been resolved then an error is thrown when the call to Pkg.dependencies() is made.

The line referenced below calls Pkg.dependencies():

for env in [proj; [p.source for p in values(Pkg.dependencies())]]

@cjdoris would it make sense to guard that call based on whether the environment has been resolved or not?

Related to that, on the line above:

Pkg.activate(proj; io = devnull)

each environment is Pkg.activated prior to calling Pkg.dependencies(). There is a method of dependencies that takes an EnvCache so it's not (I believe) required to activate everything in the load path for the operation that that code is doing.

I'm happy to take a look at making the fix if you're alright with the proposed changes?


This came up in PumasAI/QuartoNotebookRunner.jl#256 (comment). We are now using PythonCall to support having Python cells in our Quarto backend. Thanks for making that possible with your work here!

@cjdoris
Copy link
Collaborator

cjdoris commented Feb 21, 2025

Hmmmm ok interesting!

Presumably by unresolved you mean there is no Manifest.toml, or it exists and is out of date?

It's not totally obvious. I suppose that since we cannot read the dependencies this way, our two options are either to error or to ignore such a project.

Given it might be some project lower down the load path that isn't even being used, ignoring it seems to be ok? We should probably at least log a warning in this case.

As for avoiding needing to activate the project, if there is a better faster way, be my guest. Is EnvCache API or internal?

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

2 participants