Closed ArtemSokolov closed 3 years ago
Thanks @ArtemSokolov
It looks like this is caused by a recent change to the Python cryptography library which is a dependency of the Synapse client and requires a Rust compiler to be available to compile from source as of a new release a few days ago.
We will need to release a new version of synapser to improve its compatibility due to this change. In the meantime a workaround is setting the following environment variable before installing synapser:
export CRYPTOGRAPHY_DONT_BUILD_RUST=true
The workaround works great! Thanks very much.
Hi, the workaround still doesn't work for me.
Traceback (most recent call last):
File "
_install_pip(["synapseclient=={}".format(SYNAPSE_CLIENT_PACKAGE_VERSION)], localSitePackages) File "/tmp/RtmpeS1o1d/R.INSTALL3711447135ba/synapser/inst/python/installPythonClient.py", line 175, in _install_pip
raise Exception("pip.main returned {} when installing {}".format(rc, package)) Exception : pip.main returned 1 when installing synapseclient==2.2.2 Error in PythonEmbedInR::pyExec(command) : An error has occurred while executing Python code. See traceback above. Execution halted ERROR: configuration failed for package ‘synapser’
@QuanWan89 can you indicate what platform (Linux distribution and version or Docker image) you are encountering the issue on? The above workaround for now continues to work across the platforms that I tested.
e.g.
export CRYPTOGRAPHY_DONT_BUILD_RUST=true
R -e 'install.packages( "synapser", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org") )'
Hi, it is a docker image. Within the container: PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" VERSION_CODENAME=stretch ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.11 (stretch) Release: 9.11 Codename: stretch
@QuanWan89 can you show the Dockerfile or indicate the base image? Is it debian:stretch
?
If I remember correctly, it may use rocker/rstudio:3.6
@QuanWan89 I am able to install using rocker/rstudio:3.6 and the above workaround. On a base rocker/rstudio:3.6 I did have to apt-get install zlib1g-dev first (zlib-dev being a current SystemRequirement in the DESCRIPTION file)
e.g.
docker run -ti rocker/rstudio:3.6 /bin/bash
apt-get install zlib1g-dev
export CRYPTOGRAPHY_DONT_BUILD_RUST=true
R -e 'install.packages( "synapser", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org") )'
When writing a Dockerfile
, you need to have:
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=true
Doing the export
will not work.
RUN export CRYPTOGRAPHY_DONT_BUILD_RUST=true
You can also set a local environment variable for the installation command only. This should work inside or outside of a Dockerfile, e.g.
CRYPTOGRAPHY_DONT_BUILD_RUST=true R -e 'install.packages( "synapser", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org") )
or inside a Dockerfile:
RUN CRYPTOGRAPHY_DONT_BUILD_RUST=true R -e 'install.packages( "synapser", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org") )
If helpful, here's a fully functioning Dockerfile that installs synapser
as well as my extensions that streamline its usage in functional programming: https://github.com/ArtemSokolov/synExtra/blob/docker/Dockerfile
Download the Dockerfile and build the container image with docker build -t test .
Example usage after the image is built:
$ docker run -it --rm test /bin/bash
root@c54d8ae131d4:/# R -q
> synapser::synLogin( <username>, <password> )
Welcome, Artem Sokolov!NULL
> synExtra::synName( "syn1896429", "syn1901530" )
syn1896429 syn1901530
"ESTIMATE_scores_PANCAN11.tsv" "ESTIMATE_scores_PANCAN11_RNASeqV2.tsv"
synapser 0.10 resolves this issue. It can be installed as normal.
install.packages("synapser", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org"))
Operating system and R/tidyverse environment
Ubuntu 20.04 LTS R 4.0.1 tidyverse 1.3.0
Description of the problem
Installing the package raises the following exception:
The issue can be reproduced with a Docker container: