Synapser is a wrapper around the Python client. Due to this, there are some complexities in installing the package. Please follow this guide.
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.
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.
Install R > v4.1.3
Install RStudio Desktop
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.1.3\bin\R.exe
~/.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.~/.virtualenvs/r-reticulate
before re-building (it will be re-created).$HOME\AppData\Local\R\win-library\4.2\00LOCK-synapser
)/usr/bin/python
3 - but it doesn’t work
well.C:\Users\USER\AppData\Local\Programs\Python\Python310\
install.packages("synapser", repos = c("http://ran.synapse.org", "https://cloud.r-project.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.
To select our desired Python interpreter, let’s navigate to Tools > Project Options (or Global Options)
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.