KrishnaswamyLab / MAGIC

MAGIC (Markov Affinity-based Graph Imputation of Cells), is a method for imputing missing values restoring structure of large biological datasets.
GNU General Public License v2.0
334 stars 97 forks source link

Cannot load package phateR or install it #183

Closed ShaowenJ closed 4 years ago

ShaowenJ commented 4 years ago

Describe the bug I cannot load the R package phateR

To Reproduce install.packages("phateR") trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/phateR_1.0.0.tgz' Content type 'application/x-gzip' length 3992559 bytes (3.8 MB)

downloaded 3.8 MB The downloaded binary packages are in /var/folders/1s/lgcw61bd1558shr98jgdr4w40000gn/T//RtmpDwIcw6/downloaded_packages

library(phateR) Error: package or namespace load failed for ‘phateR’: .onLoad failed in loadNamespace() for 'phateR', details: call: python_config(python_version, required_module, python_versions) error: Error 1 occurred running /usr/bin/python3

Expected behavior

Actual behavior

System information:

Output of magic.__version__:

python -c 'import magic; print(magic.__version__)'`
2.0.3

Output of pd.show_versions():

``` python -c 'import pandas as pd; pd.show_versions()' INSTALLED VERSIONS ------------------ commit : None python : 3.7.4.final.0 python-bits : 64 OS : Darwin OS-release : 19.3.0 machine : x86_64 processor : i386 byteorder : little LC_ALL : None LANG : en_US.UTF-8 LOCALE : en_US.UTF-8 pandas : 0.25.1 numpy : 1.17.2 pytz : 2019.3 dateutil : 2.8.0 pip : 19.2.3 setuptools : 41.4.0 Cython : 0.29.13 pytest : 5.2.1 hypothesis : None sphinx : 2.2.0 blosc : None feather : None xlsxwriter : 1.2.1 lxml.etree : 4.4.1 html5lib : 1.0.1 pymysql : None psycopg2 : None jinja2 : 2.10.3 IPython : 7.8.0 pandas_datareader: None bs4 : 4.8.0 bottleneck : 1.2.1 fastparquet : None gcsfs : None lxml.etree : 4.4.1 matplotlib : 3.1.1 numexpr : 2.7.0 odfpy : None openpyxl : 3.0.0 pandas_gbq : None pyarrow : None pytables : None s3fs : None scipy : 1.3.1 sqlalchemy : 1.3.9 tables : 3.5.2 xarray : None xlrd : 1.2.0 xlwt : 1.3.0 xlsxwriter : 1.2.1 ```

Output of sessionInfo():

``` library(Rmagic) xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Error: package or namespace load failed for ‘Rmagic’: .onLoad failed in loadNamespace() for 'Rmagic', details: call: python_config(python_version, required_module, python_versions) error: Error 1 occurred running /usr/bin/python3 In addition: Warning message: In system2(command = python, args = paste0("\"", config_script, : running command ''/usr/bin/python3' "/Library/Frameworks/R.framework/Versions/3.6/Resources/library/reticulate/config/config.py"' had status 1 sessionInfo() R version 3.6.0 (2019-04-26) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS 10.15.3 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Matrix_1.2-17 loaded via a namespace (and not attached): [1] Rcpp_1.0.3 pillar_1.4.3 compiler_3.6.0 remotes_2.1.0 prettyunits_1.0.2 [6] tools_3.6.0 testthat_2.1.1 pkgload_1.0.2 digest_0.6.23 pkgbuild_1.0.3 [11] jsonlite_1.6.1 memoise_1.1.0 tibble_2.1.3 gtable_0.3.0 lattice_0.20-38 [16] pkgconfig_2.0.3 rlang_0.4.4 cli_2.0.1 rstudioapi_0.10 curl_4.3 [21] xfun_0.8 withr_2.1.2 dplyr_0.8.3 knitr_1.23 fs_1.3.1 [26] desc_1.2.0 devtools_2.2.1 rprojroot_1.3-2 grid_3.6.0 tidyselect_0.2.5 [31] reticulate_1.12 glue_1.3.1 R6_2.4.1 processx_3.4.1 sessioninfo_1.1.1 [36] ggplot2_3.2.1 purrr_0.3.3 callr_3.3.1 magrittr_1.5 usethis_1.5.1 [41] backports_1.1.4 ps_1.3.0 scales_1.1.0 ellipsis_0.3.0 assertthat_0.2.1 [46] colorspace_1.4-1 lazyeval_0.2.2 munsell_0.5.0 crayon_1.3.4 ```

Output of reticulate::py_discover_config(required_module = "magic"):

``` xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Error in python_config(python_version, required_module, python_versions) : Error 1 occurred running /usr/bin/python3 In addition: Warning message: In system2(command = python, args = paste0("\"", config_script, : running command ''/usr/bin/python3' "/Library/Frameworks/R.framework/Versions/3.6/Resources/library/reticulate/config/config.py"' had status 1 ```

Additional context Add any other context about the problem here.

scottgigante commented 4 years ago

Hi @Lesdormis , what happens when you run the following?

which python
/usr/bin/python3 -c 'import magic; print(magic.__version__)'

and in R:

reticulate::py_config()
ShaowenJ commented 4 years ago

Hi @scottgigante I fixed it by changing the default python version in R to python3

Thanks for the reply

scottgigante commented 4 years ago

Great, glad it's solved!