rapids/docs/developers/virtual-environments.md

36 lines
1.5 KiB
Markdown
Raw Normal View History

2020-12-04 20:57:13 +01:00
## Python Virtual Environment
2020-12-04 20:57:13 +01:00
### Add new packages
2020-12-04 20:57:13 +01:00
Try to install any new package using `conda install -c CHANNEL PACKAGE_NAME` (you can use `pip` if the package is only available there). Make sure your Python virtual environment is active (`conda activate YOUR_ENV`).
2020-12-04 20:57:13 +01:00
### Remove packages
Uninstall packages using the same manager you used to install them `conda remove PACKAGE_NAME` or `pip uninstall PACKAGE_NAME`
2020-12-04 20:57:13 +01:00
### Update your conda `environment.yaml`
2020-12-04 20:57:13 +01:00
After installing or removing a package you can use the following command in your terminal to update your `environment.yaml` before publishing your pipeline. Note that we ignore the package version for `libfortran` to keep compatibility with Linux:
```bash
conda env export --no-builds | sed 's/^.*libgfortran.*$/ - libgfortran/' > environment.yml
```
2020-12-04 20:57:13 +01:00
## R Virtual Environment
2020-12-04 20:57:13 +01:00
### Add new packages
1. Open your terminal and navigate to RAPIDS' root folder
2. Run `R` to open an R interactive session
3. Run `renv::install("PACKAGE_NAME")`
### Remove packages
1. Open your terminal and navigate to RAPIDS' root folder
2. Run `R` to open an R interactive session
3. Run `renv::remove("PACKAGE_NAME")`
### Update your R `renv.lock`
After installing or removing a package you can use the following command in your terminal to update your `renv.lock` before publishing your pipeline.
1. Open your terminal and navigate to RAPIDS' root folder
2. Run `R` to open an R interactive session
3. Run `renv::snapshot()` (renv will ask you to confirm any updates to this file)