Hi synapse team,
I recently decided to reinstall synapser and synapserutils on my macOS High Sierra Version 10.13.6 with R Version 4.0.5. However, I keep facing this error regarding PythonEmbedInR.dylib object.
```
install.packages("synapser", repos = c("http://ran.synapse.org", "http://cran.fhcrc.org"))
install.packages("synapserutils", repos=c("http://ran.synapse.org", "http://cran.fhcrc.org"))
installing the source package ?synapserutils?
trying URL 'http://ran.synapse.org/src/contrib/synapserutils_0.1.6.tar.gz'
Content type 'application/x-tar' length 15019 bytes (14 KB)
==================================================
downloaded 14 KB
* installing *source* package ?synapserutils? ...
** using staged installation
WARNING: ignoring environment value of R_HOME
Error: package or namespace load failed for ?synapser? in library.dynam(lib, package, package.lib):
shared object ?PythonEmbedInR.dylib? not found
In addition: Warning message:
package ?synapser? was built under R version 4.0.3
Execution halted
ERROR: configuration failed for package ?synapserutils?
* removing ?/Library/Frameworks/R.framework/Versions/4.0/Resources/library/synapserutils?
The downloaded source packages are in
?/private/var/folders/sh/j75jldbx3dd9tqtqn1qptmdc0000gr/T/RtmpvFqTkb/downloaded_packages?
Warning message:
In install.packages("synapserutils", repos = c("http://ran.synapse.org", :
installation of package ?synapserutils? had non-zero exit status
```
Here is my python path:
```
pyPrint("sys.path")
['/Library/Frameworks/R.framework/Versions/4.0/Resources/library/synapser/python', '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/PythonEmbedInR/python', '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/PythonEmbedInR/lib', '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/PythonEmbedInR/lib/python36.zip', '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/PythonEmbedInR/lib/python3.6', '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/PythonEmbedInR/lib/python3.6/lib-dynload', '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/PythonEmbedInR/lib/python3.6/site-packages', '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/synapser/lib/python3.6/site-packages']
```
From devtools::session_info():
```
? Session info ???????????????????????????????????????????????????????????????
setting value
version R version 4.0.5 (2021-03-31)
os macOS High Sierra 10.13.6
system x86_64, darwin17.0
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/Chicago
date 2021-05-03
? Packages ???????????????????????????????????????????????????????????????????
package * version date lib source
cachem 1.0.4 2021-02-13 [1] CRAN (R 4.0.2)
callr 3.6.0 2021-03-28 [1] CRAN (R 4.0.2)
cli 2.4.0 2021-04-05 [1] CRAN (R 4.0.5)
codetools 0.2-18 2020-11-04 [1] CRAN (R 4.0.5)
crayon 1.4.1 2021-02-08 [1] CRAN (R 4.0.3)
desc 1.3.0 2021-03-05 [1] CRAN (R 4.0.2)
devtools 2.4.0 2021-04-07 [1] CRAN (R 4.0.5)
ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.2)
fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.0.2)
ForHunt * 1.0 2021-04-30 [1] local
fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.2)
glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2)
lifecycle 1.0.0 2021-02-15 [1] CRAN (R 4.0.2)
magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.0.2)
memoise 2.0.0 2021-01-26 [1] CRAN (R 4.0.2)
pack 0.1-1 2020-07-15 [1] local
pkgbuild 1.2.0 2020-12-15 [1] CRAN (R 4.0.2)
pkgload 1.2.1 2021-04-06 [1] CRAN (R 4.0.5)
prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.2)
processx 3.5.1 2021-04-04 [1] CRAN (R 4.0.2)
ps 1.6.0 2021-02-28 [1] CRAN (R 4.0.3)
purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.2)
PythonEmbedInR * 0.7.80 2021-04-23 [1] local
R6 * 2.5.0 2020-10-28 [1] CRAN (R 4.0.2)
remotes 2.3.0 2021-04-01 [1] CRAN (R 4.0.2)
rjson * 0.2.20 2018-06-08 [1] CRAN (R 4.0.2)
rlang 0.4.10 2020-12-30 [1] CRAN (R 4.0.2)
rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.0.2)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.2)
synapser * 0.10.89 2021-04-28 [1] local
testthat 3.0.2 2021-02-14 [1] CRAN (R 4.0.2)
usethis 2.0.1 2021-02-10 [1] CRAN (R 4.0.3)
withr 2.4.2 2021-04-18 [1] CRAN (R 4.0.2)
[1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library
```
I found a similar problem [here](https://github.com/Sage-Bionetworks/synapser/issues/156). But couldn't find a suitable solution. I would appreciate your help.
Thanks,
Shiva.
Created by Shiva Kazempour ShivaKazempour Hello @jordank ,
Sorry for the delay in my response. find.package works from command line:
```
R -e ".libPaths(); find.package('synapser'); library(synapser)"
> .libPaths(); find.package('synapser'); library(synapser)
[1] "/Library/Frameworks/R.framework/Versions/4.0/Resources/library"
[1] "/Library/Frameworks/R.framework/Versions/4.0/Resources/library/synapser"
```
I used to have an .Renviron before but it is empty right now, I also tried to uset R_HOME but nothing happened and I still cannot install synapserutils. It keeps saying that **_package ?synapserutils? is available as a source package but not as a binary_**
I have to mention again that no matter if I install synapser and PythonEmbedInR from source or as binary, when I try to install synapserutils as a source package I get this error:
```
> install.packages("synapserutils", repos=c("http://cran.fhcrc.org", "http://ran.synapse.org"))
installing the source package ?synapserutils?
trying URL 'http://ran.synapse.org/src/contrib/synapserutils_0.1.6.tar.gz'
Content type 'application/x-tar' length 15019 bytes (14 KB)
==================================================
downloaded 14 KB
* installing *source* package ?synapserutils? ...
** using staged installation
WARNING: ignoring environment value of R_HOME
Error: package or namespace load failed for ?synapser? in library.dynam(lib, package, package.lib):
shared object ?PythonEmbedInR.dylib? not found
In addition: Warning message:
package ?synapser? was built under R version 4.0.3
Execution halted
ERROR: configuration failed for package ?synapserutils?
* removing ?/Library/Frameworks/R.framework/Versions/4.0/Resources/library/synapserutils?
The downloaded source packages are in
?/private/var/folders/sh/j75jldbx3dd9tqtqn1qptmdc0000gr/T/RtmpHhxiBN/downloaded_packages?
Warning message:
In install.packages("synapserutils", repos = c("http://cran.fhcrc.org", :
installation of package ?synapserutils? had non-zero exit status
```
Many thanks for your help. @ShivaKazempour
Hmm, that's odd, especially after you were able to load synapser in a normal session.
Does find.package or library from the command line also fail?
```
R -e ".libPaths(); find.package('synapser'); library(synapser)"
```
I think this might be getting at what the issue, relating to accessibility of some of the binary package installed dylibs, and possibly also related to the warning you are getting about ignoring an R_HOME environment variable (from your output before)
```
WARNING: ignoring environment value of R_HOME
```
Do you have an .Rprofile or .Renviron setting this variable or do you have an envronment variable set in your shell (manually or via a shell profile)?
If so can you try unsetting it (by removing it from an .R### file if there or by unsetting it from your shell environment (e.g. ** unset R_HOME**), then restarting your R session and then repeating the steps to uninstall and reinstall from the first step?
Thanks. Hi @jordank
I tried installing from command line but apparently it cannot find the "synapser" package.
```
~ kazempour$ curl -O http://ran.synapse.org/src/contrib/synapserutils_0.1.6.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15019 100 15019 0 0 41488 0 --:--:-- --:--:-- --:--:-- 41603
~ kazempour$ R CMD INSTALL -d synapserutils_0.1.6.tar.gz
processing ?synapserutils_0.1.6.tar.gz?
a file
* installing to library ?/Library/Frameworks/R.framework/Versions/4.0/Resources/library?
* build_help_types=
* DBG: 'R CMD INSTALL' now doing do_install()
* created lock directory ?/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-synapserutils?
* installing *source* package ?synapserutils? ...
** using staged installation
configure command: ? ./configure ?
WARNING: ignoring environment value of R_HOME
Error in library("synapser") : there is no package called ?synapser?
Execution halted
ERROR: configuration failed for package ?synapserutils?
* removing ?/Library/Frameworks/R.framework/Versions/4.0/Resources/library/synapserutils?
```
Thank you. @ShivaKazempour
Hmm, synapserutils has no dependencies beyond those of synapser itself, so it's confusing that you are able to load synapser but not synapserutils.
Could you try the following from the command line (not with an R session):
```
# download the synapserutils source package directly
curl -O http://ran.synapse.org/src/contrib/synapserutils_0.1.6.tar.gz
# install it from command line with debug option
R CMD INSTALL -d synapserutils_0.1.6.tar.gz
```
And show the full output of the above commands?
Thanks. Hi @jordank ,
Thank you for your response. I recently deleted and reinstalled my R using a pkg installer ([here](https://cloud.r-project.org/bin/macosx/)) as you mentioned.
synapser can be loaded without any warning or errors (either if I install it using mac.binary or without it):
```
> library(synapser)
TERMS OF USE NOTICE:
When using Synapse, remember that the terms and conditions of use require that you:
1) Attribute data contributors when discussing these data or results from these data.
2) Not discriminate, identify, or recontact individuals or groups represented by the data.
3) Use and contribute only data de-identified to HIPAA standards.
4) Redistribute data only under these same terms of use.
```
Also, no warning or error occurred while installing synapser and PythonEmbedInR :
```
> install.packages("PythonEmbedInR", repos=c("http://cran.fhcrc.org", "http://ran.synapse.org"), type="mac.binary")
trying URL 'http://ran.synapse.org/bin/macosx/contrib/4.0/PythonEmbedInR_0.7.80.tgz'
Content type 'application/x-tar' length 46700027 bytes (44.5 MB)
==================================================
downloaded 44.5 MB
The downloaded binary packages are in
/var/folders/sh/j75jldbx3dd9tqtqn1qptmdc0000gr/T//Rtmpx8a2kj/downloaded_packages
> install.packages("synapser", repos=c("http://cran.fhcrc.org", "http://ran.synapse.org"), type="mac.binary")
trying URL 'http://ran.synapse.org/bin/macosx/contrib/4.0/synapser_0.10.89.tgz'
Content type 'application/x-tar' length 37732177 bytes (36.0 MB)
==================================================
downloaded 36.0 MB
The downloaded binary packages are in
/var/folders/sh/j75jldbx3dd9tqtqn1qptmdc0000gr/T//Rtmpx8a2kj/downloaded_packages
```
However, synapserutils cannot be installed with mac.type option:
```
install.packages("synapserutils", repos=c("http://cran.fhcrc.org", "http://ran.synapse.org"), type="mac.binary")
package ?synapserutils? is available as a source package but not as a binary
Warning message:
package ?synapserutils? is not available as a binary package for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
```
And if I try to download it without mac.binary option, I get the same error as the one in my original question.
Thanks again for helping me.
Shiva.
Hi @ShivaKazempour ,
Do you recall how you installed R. Was it e.g. from a pkg installer [here](https://cloud.r-project.org/bin/macosx/) or did you compile it from source, or install it via some other package manager?
Also can I assume that loading **synapser** itself is also yielding the same error when it is loaded (as opposed to synapserutils), e.g.
```
library(synapser)
```
If so, could you try removing the packages, PythonEmbedInR, synapser, and synapserutils and then installing them one by one, and showing any intermediate errors (if there were any), using the type='mac.binary' option?
```
remove.packages(c('PythonEmbedInR', 'synapser', 'synapserutils'))
```
```
install.packages("PythonEmbedInR", repos=c("http://cran.fhcrc.org", "http://ran.synapse.org"), type="mac.binary")
```
```
install.packages("synapser", repos=c("http://cran.fhcrc.org", "http://ran.synapse.org"), type="mac.binary")
```
```
install.packages("synapserutils", repos=c("http://cran.fhcrc.org", "http://ran.synapse.org"), type="mac.binary")
```
Thanks!
Drop files to upload
shared object ?PythonEmbedInR.dylib? not found when installing synapserutils page is loading…