Comments (3)
I'm reluctant to add hooks like this because it messes with the declarative nature of CondaPkg (note that modern package managers tend not to have hooks like this). I'm not totally ruling it out but it does go against the grain.
The natural way to do what you want would be to have RCall depend directly on CondaPkg (as PythonCall does) and read the Conda env directly from there. If you're using Preferences.jl you can conditionally load CondaPkg so that there is no runtime cost unless the user opts into CondaPkg.
Or you could do the same but with CondaPkg being a weak dependency and using a package extension to enable this behaviour. I'm not sure if this will work (I don't know if a package extension is able to change the behaviour of the parent package's __init__
function).
Alternatively you could create CondaPkgRCall.jl which has a Conda dependency on R and sets the libR preference either in __init__
(I'm not sure how this composes with compile-time preferences) or some other function that the user explicitly calls. Obviously this has downsides.
from condapkg.jl.
from condapkg.jl.
Thanks for explaining this all to me. After thinking it about it a bit more, I'm not sure this would help as much as I thought. I was thinking about the case of running ]conda install
in the REPL, and being able to set a preference pointing to a valid R as it is installed, so that it would be available to RCall.jl in subsequent interpreters, but with CondaPkg.jl
, R could actually be installed under a variety of circumstances. In some of these circumstances it would be the case that RCall has already be imported, and it is far too late to be setting compile time preferences for the current Julia session.
Having thought about my understanding of the order in which things are initialised, I'm becoming increasingly convinced that "do what PythonCall does" is the only clean option. Unfortunately this would end up with Conda.jl and CondaPkg.jl as dependencies of RCall.jl: so either splitting packages for different cases or introducing a breaking change into RCall.jl. Thanks again for helping me reflect on this. I will close this issue now.
from condapkg.jl.
Related Issues (20)
- Not able to specify βextrasβ in `pip_add` ? HOT 1
- Set conda environment for a package HOT 2
- CondaPkg constantly uninstalling, reinstalling all packages HOT 4
- `conda-build` and `conda skeleton` HOT 3
- Automatically load conda packages from the dependend julia packages HOT 3
- To do: ignore indirect dependencies on CondaPkg
- How to make RCall.jl use a CondaPkg.jl environment? HOT 8
- add preferences to control allowed channels and priority
- freeze the environment by default when it is activated HOT 2
- add completions for rm, pip_rm and channel_rm HOT 1
- dependency overrides HOT 1
- [Bug] file is not passed to write_toml HOT 2
- only add channel if it is not already added
- using CondaPkg with Pluto leads to unnecesarry resolves HOT 7
- Feature Request: Support CONDA_CHANNELS to set conda channels HOT 1
- access denied.: "C:\Users\...\v1.9\.CondaPkg\env\DLLs\_ctypes.pyd.mamba_trash" HOT 1
- `pip_add` for URLs HOT 6
- `critical libmamba could not load prefix data` after conda add failed due to low memory HOT 1
- Make `--override-channels` optional? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from condapkg.jl.