Synapser is a wrapper around the Python client. Due to this, there are some complexities in installing the package. Please follow this guide.

Install Python and R

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 - 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....

    ``` % which -a python3 /usr/bin/python3 # <- Default Python shipped with macOS

    % which -a python3 /usr/local/bin/python3 # <- Official Python installer (3.11.1 for me) /usr/bin/python3 # <- Default Python shipped with macOS ```

    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. 1. Install R > v4.2.2 a. Download links i. For macOS users, you can select a mirror and download R here ii. For Windows and Linux users, you can select a mirror and download R here NOTE: There might be an issue installing v4.0.0; please use v4.2.2+ for the best experience 1. Install RStudio Desktop 1. For Windows users, if you intend to run the project from outside 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

Synapse Installation

Install from RStudio

install.packages("synapser", repos = c("http://ran.synapse.org", "http://cran.fhcrc.org"))

Once that's complete, we are ready to move on to selecting our desired Python interpreter. If the above fails, follow 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)

{#id .class width=600 height=400px}

  1. Let's select Python from the list of options on the left hand side:

{#id .class width=600 height=400px}

  1. Click Select

{#id .class width=600 height=400px}

  1. Select the Virtual Environments tab:

{#id .class width=600 height=400px}

  1. Click on Select to choose our desired Reticulate virtual environment:

{#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) installed from the official Python installer and NOT the Python version that shipped on macOS - is selected.



Sage-Bionetworks/synapser documentation built on Feb. 7, 2024, 12:26 p.m.