You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: INSTALL.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,36 +6,36 @@ Keeping this comprehensive will require input from the community.
6
6
7
7
So please email sacro.contact@uwe.ac.uk, or [raise an issue on the GitHub repository](https://github.com/AI-SDC/ACRO-R/issues/new/choose) if:
8
8
- you have a setting that is not covered, or
9
-
- the steps outlined below do not work for you,
9
+
- the steps outlined below do not work for you,
10
10
11
-
**Please note**: most of the scenarios below assume that
11
+
**Please note**: most of the scenarios below assume that
12
12
- you have a working version of Python 3 (version 3.9 or higher) on your system
13
13
- you are able to access a terminal or command prompt to write and execute some commands.
14
14
15
15
---
16
16
17
17
## Step 1 create a python virtual environment and install the base python package *acro*
18
-
**In every case** we recommend that you create what is called a 'python virtual environment' called **r-acro**.
19
-
Virtual environments (*venv's*) are recommended best practice.
20
-
This is because they isolate the impact of any changes you make in one venv - such as adding or updating a package- from the rest of your system.
18
+
**In every case** we recommend that you create what is called a 'python virtual environment' called **r-acro**.
19
+
Virtual environments (*venv's*) are recommended best practice.
20
+
This is because they isolate the impact of any changes you make in one venv - such as adding or updating a package- from the rest of your system.
21
21
22
22
There are many tutorials available on the web if you get stuck.
23
23
We do not endorse any particular site, but here are some examples:
24
24
-[an overview with examples for windows/linux/mac](https://python.land/virtual-environments/virtualenv)
25
25
-[another that also contains instructions for VSCode and Pycharm](https://realpython.com/python-virtual-environments-a-primer/)
26
-
27
-
**For individual users** we suggest that you do this in your home directory where you should have write permission.
26
+
27
+
**For individual users** we suggest that you do this in your home directory where you should have write permission.
28
28
29
29
**To install site-wide** we assume you have access rights and know where your organisation's preferred locations are (for example, this might be ```/usr/local``` on a linux system).
30
30
31
31
### Make a dedicated virtual environment
32
32
You can make a new virtual environment via:
33
33
- the Anaconda GUI interface to the conda system
34
-
- command line access - by opening a terminal or command prompt and entering the command:
34
+
- command line access - by opening a terminal or command prompt and entering the command:
35
35
```sh
36
36
conda create --n r-acro
37
37
```
38
-
if you have a version of conda installed or
38
+
if you have a version of conda installed or
39
39
```sh
40
40
python -m venv ./r-acro
41
41
```
@@ -49,7 +49,7 @@ Anaconda comes with its own GUI to makes this process easy.
49
49
conda activate r-acro
50
50
conda install conda-forge::acro
51
51
52
-
#assuming this completes successfuly you can now exit
52
+
#assuming this completes successfully you can now exit
53
53
conda deactivate r-acro
54
54
```
55
55
@@ -63,7 +63,7 @@ r-acro\Scripts\Activate.ps1
63
63
followed by
64
64
```sh
65
65
python -m pip install acro
66
-
#assuming this completes successfuly you can now exit the virtual environment
66
+
#assuming this completes successfully you can now exit the virtual environment
67
67
deactivate
68
68
```
69
69
@@ -73,17 +73,17 @@ deactivate
73
73
source r-acro/bin/activate
74
74
#you should see the your command prompt change to show (r-acro)
75
75
python -m pip install acro
76
-
#assuming this completes successfuly you can now exit the virtual environment
77
-
deactivate
76
+
#assuming this completes successfully you can now exit the virtual environment
77
+
deactivate
78
78
```
79
79
---
80
80
81
81
## Step 2 Install the R packages *reticulate* and *acro*
82
82
83
83
The *reticulate* package is the industry-standard method for supporting communications between R and Python.
84
-
It provides the `plumbing` between the R `front-end'
84
+
It provides the `plumbing` between the R `front-end'
85
85
86
-
These commands should work whether you are
86
+
These commands should work whether you are
87
87
- working on a machine outside the TRE: in which case packages should install from a mirror of the CRAN service
88
88
- working on a machine inside a TRE: in which case the administrator should have set up a local mirror of approved packages from CRAN
89
89
@@ -94,7 +94,7 @@ install.packages*("reticulate")
94
94
install.packages("acro")
95
95
```
96
96
97
-
**For adminstrators wishing to install for all users site-wide** the commands are the same but you will need to run them in *sudo* mode.
97
+
**For administrators wishing to install for all users site-wide** the commands are the same but you will need to run them in *sudo* mode.
98
98
99
99
---
100
100
@@ -105,7 +105,7 @@ What we need to do is to set the value of a global variable ```RETICULATE_PYTHON
105
105
The [R documentation for doing this](https://rstudio.github.io/reticulate/articles/versions.html) is a little inconsistent here, but the following options all seem to work.
106
106
107
107
### Option 1- For individuals using RStudio
108
-
If you follow the menu items from ```Tools->Project Options ->Python``` or ```Tools->Global Options->Python``` you can tell it to use the version of python from the virtual environment you create in step 1, either for a specifc R project or for all your sessions as shown below
108
+
If you follow the menu items from ```Tools->Project Options ->Python``` or ```Tools->Global Options->Python``` you can tell it to use the version of python from the virtual environment you create in step 1, either for a specific R project or for all your sessions as shown below
109
109
110
110

111
111
@@ -128,7 +128,7 @@ If you follow the menu items from ```Tools->Project Options ->Python``` or ```To
128
128
library(reticulate)
129
129
library("acro)"
130
130
```
131
-
131
+
132
132
### Option 3 - Editing your personal R preferences
133
133
In your home directory create (or edit) the file ```.Rprofile``` file, adding the lines
You can also edit the [site-wide Rprofile]() file to add these global environment variables, using replacing *~/r-acro* with the path to wherever you created the dedicated virtual environment.
0 commit comments