-
Notifications
You must be signed in to change notification settings - Fork 59
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
ERROR: Cannot set preferences of an unknown package that is not loaded! #551
Comments
It seems the only way to actually fix this is to first add the RCall package (which will trigger precompilation of RCall) and then add the preferences like above. I tried writing the LocalPreferences.toml directly, but it won't actually work, |
I think this setup is also desirable behavior -- I think it makes sense to require direct dependency for something you care enough about the details of to set a preference on. |
The confusing part is on reading the preferences. Despite having LocalPreferences.toml filled with an entry for RCall, you will get the following divergent behaviour between UUID and package-name, if RCall is not added as a toplevel dependency. julia> using Preferences, UUIDs
julia> RCALL_UUID = UUID("6f49c342-dc21-5d91-9882-a32aef131414")
julia> has_preference(RCALL_UUID, "Rhome")
false
julia> has_preference("RCall", "Rhome")
ERROR: ArgumentError: Cannot resolve package 'RCall' in load path; have you added the package as a top-level dependency?
Stacktrace:
[1] package_lookup_error(name::String)
@ Preferences ~/.julia/packages/Preferences/enLcN/src/utils.jl:88
[2] has_preference(name::String, key::String)
@ Preferences ~/.julia/packages/Preferences/enLcN/src/Preferences.jl:76
[3] top-level scope
@ REPL[8]:1 |
This might be relevant/helpful: JuliaPackaging/Preferences.jl#53 |
Trying to define the preferences for RCall, I am running into an error. How to actually do this?
The text was updated successfully, but these errors were encountered: