Sage-Bionetworks / synapser

An R package providing programmatic access to Synapse
Apache License 2.0
32 stars 22 forks source link

installPythonClient.py cannot find existing setuptools #235

Closed attilagk closed 5 years ago

attilagk commented 5 years ago

Description of the problem

Installation fails with ImportError in installPythonClient.py on R 3.5.2, ubuntu 18.04. The error message says No module named 'setuptools'. But setuptools is in fact installed both for python2.7 and for python3.6; I verified this with pip show setuptools and pip3 show setuptools and I can import setuptools in my interactive Python shell.

Details

Below is the full output of install.packages

> install.packages("synapser", repos = c("https://sage-bionetworks.github.io/ran", "http://cran.fhcrc.org"))
Installing package into ‘/home/attila/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://sage-bionetworks.github.io/ran/src/contrib/synapser_0.5.45.tar.gz'
Content type 'application/gzip' length 129333 bytes (126 KB)
==================================================
downloaded 126 KB

* installing *source* package ‘synapser’ ...
Loading required package: R6
Loading required package: rjson
Loading required package: R6
Loading required package: rjson
Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/RtmpEhtLqv/R.INSTALL31961930fc22/synapser/inst/python/installPythonClient.py", line 11, in <module>

from setuptools.command.install import install
ImportError
: 
No module named 'setuptools'
Error in pyExec(sprintf("import %s", import)) : 
  An error has occurred while executing Python code. See traceback above.
Calls: <Anonymous> -> pyExec
Execution halted
ERROR: configuration failed for package ‘synapser’
* removing ‘/home/attila/R/library/synapser’

The downloaded source packages are in
        ‘/tmp/RtmptJtRIx/downloaded_packages’
Warning message:
In install.packages("synapser", repos = c("https://sage-bionetworks.github.io/ran",  :
  installation of package ‘synapser’ had non-zero exit status

Output of sessionInfo()

> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitr_1.21

loaded via a namespace (and not attached):
[1] compiler_3.5.2 tools_3.5.2    xfun_0.5      
kimyen commented 5 years ago

Thanks @attilagk for reporting the issue! I created a Jira ticket to track engineering work on this issue: https://sagebionetworks.jira.com/browse/SYNR-1394

But setuptools is in fact installed both for python2.7 and for python3.6; I verified this with pip show setuptools and pip3 show setuptools and I can import setuptools in my interactive Python shell.

synapser installs and manages its own Python environment. This environment is separated from user's Python environment. In addition, Python is not installed as executable in this environment, but is loaded as dynamic library at runtime. So the commands above only reveal what are in the user's Python environment and not what is available in synapser's Python environment.

kimyen commented 5 years ago

@attilagk, could you please help me check to see if you can successfully install PythonEmbedInR:

install.packages("PythonEmbedInR", repos=c("http://cran.fhcrc.org", "https://sage-bionetworks.github.io/ran"))
attilagk commented 5 years ago

Hi @kimyen! I could install not only PythonEmbedInR but subsequently also synapser. So this solved the problem. Thanks!