|
Last change
on this file since 616 was
336,
checked in by htune, 3 years ago
|
|
Modifying setup.sh for conda install of python
More controls on the version of python and R
Introduction of a docs directory with tests and docs
Fredho&Najda
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | library(reticulate) |
|---|
| 2 | # https://rstudio.github.io/reticulate/articles/versions.html |
|---|
| 3 | # Sys.setenv(PYTHONUSERBASE="/home/hourdin/miniconda3/envs/python38/") |
|---|
| 4 | # Sys.setenv(RETICULATE_PYTHON = "/home/hourdin/.local/lib/HighTune-pyhton3.8") |
|---|
| 5 | # export RETICULATE_PYTHON=~/.local/lib/HighTune-pyhton3.8 |
|---|
| 6 | # export RETICULATE_PYTHON=/home/hourdin/miniconda3/envs/python38/bin/python |
|---|
| 7 | |
|---|
| 8 | print("OKA") |
|---|
| 9 | #use_python("/usr/bin/python3.8") |
|---|
| 10 | #use_python("/home/hourdin/.local/lib/HighTune-pyhton3.8/bin/python3") |
|---|
| 11 | #use_python("/home/hourdin/miniconda3/envs/python38/bin/python") |
|---|
| 12 | #use_python("/home/hourdin/.local/lib/HighTune-pyhton3.8") |
|---|
| 13 | print("OK1") |
|---|
| 14 | |
|---|
| 15 | # backtracing |
|---|
| 16 | #options(error = function(e) print(rlang::trace_back())) |
|---|
| 17 | #reticulate::use_condaenv(condaenv = "python38", conda = "/home/hourdin/miniconda3/bin/conda", required=T) |
|---|
| 18 | |
|---|
| 19 | #use_condaenv(condaenv = "python38", conda = "/home/hourdin/miniconda3/bin/conda", required=T) |
|---|
| 20 | |
|---|
| 21 | #conda_list() |
|---|
| 22 | #py_discover_config() |
|---|
| 23 | #py_config() |
|---|
| 24 | #repl_python() |
|---|
| 25 | |
|---|
| 26 | #py_run_string("import scipy") |
|---|
| 27 | #scipy <- import_from_path("scipy", path="/home/hourdin/miniconda3/envs/python38/lib/python3.8/site-packages/") |
|---|
| 28 | scipy <- import("scipy") |
|---|
| 29 | scipy$amin(c(1,3,5,7)) |
|---|
| 30 | |
|---|
| 31 | py_config() |
|---|
| 32 | |
|---|
| 33 | print("scipy version") |
|---|
| 34 | print(py_get_attr(scipy, "__version__")) |
|---|
Note: See
TracBrowser
for help on using the repository browser.