Skip to content

Commit

Permalink
Update test dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasyu888 committed Feb 4, 2024
1 parent 3bf86eb commit 36e28a5
Showing 1 changed file with 18 additions and 32 deletions.
50 changes: 18 additions & 32 deletions vignettes/installation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ Synapser is a wrapper around the Python client. Due to this, there are some com

If you are not familiar with Python at all, this section is for you, but if you are familiar with setting up your Python environment, you can skip the first step.

1. Install Python from one of the official [Python installers](https://www.python.org/downloads/) - any version above 3.8
and remove other versions of Python except for the one that ships with macOS located in `usr/bin/python` (note for windows:
make sure to add Python to path if you're planning on running the project from outside RStudio, for example from terminal).
1. Install Python from one of the official [Python installers](https://www.python.org/downloads/) - any version above 3.8 and remove other versions of Python except for the one that ships with macOS located in `usr/bin/python` (note for windows: make sure to add Python to path if you're planning on running the project from outside RStudio, for example from terminal). TIP: You can verify which version you have with....

TIP: You can verify which version you have with:
```
% which -a python3
/usr/bin/python3 # <- Default Python shipped with macOS
Expand All @@ -32,30 +29,20 @@ make sure to add Python to path if you're planning on running the project from o
macOS ships with Python by default - Python 3.8 or Python 3.9.6 at the location /usr/bin/python3 - but it doesn't work well.
Only the official installer versions work. Seriously. Please do yourself a favor and avoid having a very long, sad day because you insisted on using the version that shipped with macOS by default.


2. Install R > v4.2.2

1. Install R > v4.2.2
a. Download links

i. For macOS users, you can select a mirror and download R [here](https://cran.r-project.org/bin/macosx/)
ii. For Windows and Linux users, you can select a mirror and download R [here](https://cran.r-project.org/mirrors.html)
NOTE: There might be an issue installing v4.0.0; please use v4.2.2+ for the best experience
1. Install [RStudio Desktop](https://posit.co/download/rstudio-desktop/)
1. For Windows users, if you intend to run the project from outside [RStudio Desktop](https://posit.co/download/rstudio-desktop/)
(for example: VS Code or Terminal) the only additional step is to add R to system path: `C:\Program Files\R\R-4.2.2\bin\R.exe`
NOTE: There might be an issue installing v4.0.0; please use v4.2.2+ for the best experience


3. Install [RStudio Desktop](https://posit.co/download/rstudio-desktop/)
## Troubleshooting
4. For Windows users, if you intend to run the project from outside [RStudio Desktop](https://posit.co/download/rstudio-desktop/)
(for example: VS Code or Terminal) the only additional step is to add R to system path: `C:\Program Files\R\R-4.2.2\bin\R.exe`

Troubleshooting
- If you get an error while building the project that it cannot find synapseclient module.
This is because RStudio is using the wrong python version. To get [RStudio Desktop](https://posit.co/download/rstudio-desktop/) to build the package correctly,
navigate to Tools > Project Options > Python > Virtual Envs and select the first entry `~/.virtualenvs/r-reticulate`
(or Conda if that's your preferred Python virtual env) and perform the below step. R-Studio will re-create a virtual
environment at that path using the correct Python version. Manually specifying python at the official installation path doesn't always fix it.
This is because RStudio is using the wrong python version. To get [RStudio Desktop](https://posit.co/download/rstudio-desktop/) to build the package correctly, navigate to Tools > Project Options > Python > Virtual Envs and select the first entry `~/.virtualenvs/r-reticulate` (or Conda if that's your preferred Python virtual env) and perform the below step. R-Studio will re-create a virtual environment at that path using the correct Python version. Manually specifying python at the official installation path doesn't always fix it.
- If you have already tried building the project with an older version of Python, make sure to remove `~/.virtualenvs/r-reticulate` before re-building (it will be re-created).
- If you halt the build process, a lock file might be left behind, which will need to be manually deleted (`$HOME\AppData\Local\R\win-library\4.2\00LOCK-synapser`)
- macOS ships with Python by default - Python 3.8 or Python 3.9.6 at the location `/usr/bin/python`3 - but it doesn't work well.
Expand All @@ -64,11 +51,10 @@ environment at that path using the correct Python version. Manually specifying p
# Synapse Installation
This guide assumes you have Python, R, and RStudio Desktop installed as described above.

This guide will presume most users want to install and work with Synapse from RStudio Desktop.
- This guide assumes you have Python, R, and RStudio Desktop installed as described above.
- This guide will presume most users want to install and work with Synapse from RStudio Desktop.
Install from RStudio
## Install from RStudio
```
install.packages("synapser", repos = c("http://ran.synapse.org", "http://cran.fhcrc.org"))
Expand All @@ -79,25 +65,25 @@ the steps below, then run the installation.
1. Select your project's desired Python interpreter
To select our desired Python interpreter, let's navigate to Tools > Project Options (or Global Options)
To select our desired Python interpreter, let's navigate to Tools > Project Options (or Global Options)
[synapser_options](synapser_options.png)
![](synapser_options.png){#id .class width=600 height=400px}
2. Let's select Python from the list of options on the left hand side:
[synapse_python](synapse_python.png)
![](synapser_python.png){#id .class width=600 height=400px}
3. Click Select
[synapser_select_py](synapser_select_py.png)
![](synapser_select_py.png){#id .class width=600 height=400px}
4. Select the Virtual Environments tab:
[synapser_py_env](synapser_py_env.png)
![](synapser_py_env.png){#id .class width=600 height=400px}
5. Click on Select to choose our desired Reticulate virtual environment:
[synapser_final](synapser_final.png)
![](synapser_final.png){#id .class width=600 height=400px}
In the example above, we can see that my desired Python 3.9.6 environment (your python version may be different, and that's ok)
In the example above, we can see that my desired Python 3.9.6 environment (your python version may be different, and that's ok)
installed from the official Python installer and NOT the Python version that shipped on macOS - is selected.

0 comments on commit 36e28a5

Please sign in to comment.