Irrationone / cellassign

Automated, probabilistic assignment of cell types in scRNA-seq data
Other
191 stars 79 forks source link

Cannot Install Cellassign #52

Open aaliakmal opened 4 years ago

aaliakmal commented 4 years ago

Hi Guys, So I cannot install cellassign despite downloading. Python 3.7 64 bit, Tensorflow 2.0 and its extra package. Error code it down below.

library(tensorflow) tensorflow::tf_config() TensorFlow v1.13.1 () Python v3.7 (C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate\python.exe) devtools::install_github("Irrationone/cellassign") Downloading GitHub repo Irrationone/cellassign@master √ checking for file 'C:\Users\alexanderlee\AppData\Local\Temp\RtmpAFv6rj\remotese9020cb4678\Irrationone-cellassign-bded394/DESCRIPTION' (490ms)

  • preparing 'cellassign': √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • looking to see if a 'data/datalist' file should be added
  • building 'cellassign_0.99.12.tar.gz'
kieranrcampbell commented 4 years ago

From

library(tensorflow) tensorflow::tf_config() TensorFlow v1.13.1 ()

it looks like you have tensorflow 1 installed rather than 2?

Also is your architecture really 32 bit? Can you show the output of sessionInfo() to see?

aaliakmal commented 4 years ago

So here's what sessionInfo showed me.

R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

loaded via a namespace (and not attached): [1] Seurat_3.1.0 Rtsne_0.15 colorspace_1.4-1 ellipsis_0.3.0 ggridges_0.5.1
[6] rprojroot_1.3-2 fs_1.3.1 base64enc_0.1-3 rstudioapi_0.10 leiden_0.3.1
[11] listenv_0.7.0 npsurv_0.4-0 remotes_2.1.0 ggrepel_0.8.1 codetools_0.2-16
[16] splines_3.6.1 R.methodsS3_1.7.1 lsei_1.2-0 pkgload_1.0.2 zeallot_0.1.0
[21] jsonlite_1.6 ica_1.0-2 cluster_2.1.0 png_0.1-7 R.oo_1.22.0
[26] tfruns_1.4 uwot_0.1.4 sctransform_0.2.0 compiler_3.6.1 httr_1.4.1
[31] backports_1.1.5 assertthat_0.2.1 Matrix_1.2-17 lazyeval_0.2.2 cli_1.1.0
[36] htmltools_0.3.6 prettyunits_1.0.2 tools_3.6.1 rsvd_1.0.2 igraph_1.2.4.1
[41] gtable_0.3.0 glue_1.3.1 RANN_2.6.1 reshape2_1.4.3 dplyr_0.8.3
[46] Rcpp_1.0.2 vctrs_0.2.0 gdata_2.18.0 ape_5.3 nlme_3.1-141
[51] gbRd_0.4-11 lmtest_0.9-37 stringr_1.4.0 globals_0.12.4 ps_1.3.0
[56] testthat_2.2.1 lifecycle_0.1.0 irlba_2.3.3 gtools_3.8.1 devtools_2.2.1
[61] future_1.14.0 MASS_7.3-51.4 zoo_1.8-6 scales_1.0.0 parallel_3.6.1
[66] RColorBrewer_1.1-2 curl_4.2 memoise_1.1.0 reticulate_1.13 pbapply_1.4-2
[71] gridExtra_2.3 ggplot2_3.2.1 stringi_1.4.3 tensorflow_2.0.0 desc_1.2.0
[76] caTools_1.17.1.2 pkgbuild_1.0.5 bibtex_0.4.2 Rdpack_0.11-0 SDMTools_1.1-221.1 [81] rlang_0.4.0 pkgconfig_2.0.3 bitops_1.0-6 lattice_0.20-38 ROCR_1.0-7
[86] purrr_0.3.2 htmlwidgets_1.5 cowplot_1.0.0 tidyselect_0.2.5 processx_3.4.1
[91] RcppAnnoy_0.0.13 plyr_1.8.4 magrittr_1.5 R6_2.4.0 gplots_3.0.1.1
[96] pillar_1.4.2 whisker_0.4 withr_2.1.2 fitdistrplus_1.0-14 survival_2.44-1.1
[101] tibble_2.1.3 future.apply_1.3.0 tsne_0.1-3 crayon_1.3.4 KernSmooth_2.23-15 [106] plotly_4.9.0 usethis_1.5.1 grid_3.6.1 data.table_1.12.4 callr_3.3.2
[111] metap_1.1 digest_0.6.21 tidyr_1.0.0 R.utils_2.9.0 RcppParallel_4.4.4 [116] munsell_0.5.0 viridisLite_0.3.0 sessioninfo_1.1.1

kieranrcampbell commented 4 years ago

Can you post results of reticulate::py_config() ? Looks windows-specific and related to https://github.com/rstudio/tensorflow/issues/95

aaliakmal commented 4 years ago

Here are my results for reticulate ::py_config() python: C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate\python.exe libpython: C:/Users/alexanderlee/AppData/Local/Continuum/miniconda3/envs/r-reticulate/python37.dll pythonhome: C:\Users\ALEXAN~1\AppData\Local\CONTIN~1\MINICO~1\envs\R-RETI~1 version: 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] Architecture: 64bit numpy: C:\Users\alexanderlee\AppData\Roaming\Python\Python37\site-packages\numpy numpy_version: 1.15.4 leidenalg: [NOT FOUND]

python versions found: C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate\python.exe C:\Users\ALEXAN~1\AppData\Local\Programs\Python\Python37\python.exe C:\PROGRA~3\ANACON~1\python.exe C:\Users\ALEXAN~1\AppData\Local\CONTIN~1\MINICO~1\Anaconda\python.exe C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\Anaconda\python.exe C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\Anaconda\envs\r-tensorflow\python.exe

kieranrcampbell commented 4 years ago

So when I do that on my system I see a line for tensorflow in the first half:

tensorflow: /usr/local/lib/python3.7/site-packages/tensorflow

What happens if you call C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate\pip install tensorflow ?

Also what does your tensorflow::tf_config() look like now? Have you upgraded to v2?

aaliakmal commented 4 years ago

So here's what happens when I call the python code you sent.

(base) C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate> pip install tensorflow Collecting tensorflow Downloading https://files.pythonhosted.org/packages/54/5f/e1b2d83b808f978f51b7ce109315154da3a3d4151aa59686002681f2e109/tensorflow-2.0.0-cp37-cp37m-win_amd64.whl (48.1MB) 100% |████████████████████████████████| 48.1MB 308kB/s Collecting astor>=0.6.0 (from tensorflow) Using cached https://files.pythonhosted.org/packages/d1/4f/950dfae467b384fc96bc6469de25d832534f6b4441033c39f914efd13418/astor-0.8.0-py2.py3-none-any.whl Collecting absl-py>=0.7.0 (from tensorflow) Downloading https://files.pythonhosted.org/packages/3b/72/e6e483e2db953c11efa44ee21c5fdb6505c4dffa447b4263ca8af6676b62/absl-py-0.8.1.tar.gz (103kB) 100% |████████████████████████████████| 112kB 6.6MB/s Collecting grpcio>=1.8.6 (from tensorflow) Downloading https://files.pythonhosted.org/packages/4c/e5/79974f0288e36be3205e71f91e0dbe2a5746ccaa84780c65c4d75fa4b269/grpcio-1.24.1-cp37-cp37m-win_amd64.whl (1.6MB) 100% |████████████████████████████████| 1.6MB 3.7MB/s Collecting termcolor>=1.1.0 (from tensorflow) Collecting tensorflow-estimator<2.1.0,>=2.0.0 (from tensorflow) Using cached https://files.pythonhosted.org/packages/95/00/5e6cdf86190a70d7382d320b2b04e4ff0f8191a37d90a422a2f8ff0705bb/tensorflow_estimator-2.0.0-py2.py3-none-any.whl Collecting keras-applications>=1.0.8 (from tensorflow) Using cached https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl Collecting keras-preprocessing>=1.0.5 (from tensorflow) Using cached https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl Requirement already satisfied: wheel>=0.26 in c:\users\alexanderlee\appdata\local\continuum\miniconda3\anaconda\lib\site-packages (from tensorflow) (0.31.1) Collecting opt-einsum>=2.3.2 (from tensorflow) Using cached https://files.pythonhosted.org/packages/b8/83/755bd5324777875e9dff19c2e59daec837d0378c09196634524a3d7269ac/opt_einsum-3.1.0.tar.gz Collecting google-pasta>=0.1.6 (from tensorflow) Using cached https://files.pythonhosted.org/packages/d0/33/376510eb8d6246f3c30545f416b2263eee461e40940c2a4413c711bdf62d/google_pasta-0.1.7-py3-none-any.whl Collecting protobuf>=3.6.1 (from tensorflow) Downloading https://files.pythonhosted.org/packages/a8/ae/a11b9b0c8e2410b11887881990b71f54ec39b17c4de2b5d850ef66aade8c/protobuf-3.10.0-cp37-cp37m-win_amd64.whl (1.0MB) 100% |████████████████████████████████| 1.0MB 5.1MB/s Collecting wrapt>=1.11.1 (from tensorflow) Requirement already satisfied: six>=1.10.0 in c:\users\alexanderlee\appdata\local\continuum\miniconda3\anaconda\lib\site-packages (from tensorflow) (1.11.0) Collecting numpy<2.0,>=1.16.0 (from tensorflow) Downloading https://files.pythonhosted.org/packages/bd/51/7df1a3858ff0465f760b482514f1292836f8be08d84aba411b48dda72fa9/numpy-1.17.2-cp37-cp37m-win_amd64.whl (12.8MB) 100% |████████████████████████████████| 12.8MB 1.6MB/s Collecting gast==0.2.2 (from tensorflow) Collecting tensorboard<2.1.0,>=2.0.0 (from tensorflow) Using cached https://files.pythonhosted.org/packages/9b/a6/e8ffa4e2ddb216449d34cfcb825ebb38206bee5c4553d69e7bc8bc2c5d64/tensorboard-2.0.0-py3-none-any.whl Collecting h5py (from keras-applications>=1.0.8->tensorflow) Downloading https://files.pythonhosted.org/packages/a1/6b/7f62017e3f0b32438dd90bdc1ff0b7b1448b6cb04a1ed84f37b6de95cd7b/h5py-2.10.0-cp37-cp37m-win_amd64.whl (2.5MB) 100% |████████████████████████████████| 2.5MB 4.3MB/s Requirement already satisfied: setuptools in c:\users\alexanderlee\appdata\local\continuum\miniconda3\anaconda\lib\site-packages (from protobuf>=3.6.1->tensorflow) (40.2.0) Collecting markdown>=2.6.8 (from tensorboard<2.1.0,>=2.0.0->tensorflow) Using cached https://files.pythonhosted.org/packages/c0/4e/fd492e91abdc2d2fcb70ef453064d980688762079397f779758e055f6575/Markdown-3.1.1-py2.py3-none-any.whl Collecting werkzeug>=0.11.15 (from tensorboard<2.1.0,>=2.0.0->tensorflow) Using cached https://files.pythonhosted.org/packages/ce/42/3aeda98f96e85fd26180534d36570e4d18108d62ae36f87694b476b83d6f/Werkzeug-0.16.0-py2.py3-none-any.whl Building wheels for collected packages: absl-py, opt-einsum Running setup.py bdist_wheel for absl-py ... done Stored in directory: C:\Users\alexanderlee\AppData\Local\pip\Cache\wheels\a7\15\a0\0a0561549ad11cdc1bc8fa1191a353efd30facf6bfb507aefc Running setup.py bdist_wheel for opt-einsum ... done Stored in directory: C:\Users\alexanderlee\AppData\Local\pip\Cache\wheels\2c\b1\94\43d03e130b929aae7ba3f8d15cbd7bc0d1cb5bb38a5c721833 Successfully built absl-py opt-einsum tensorboard 2.0.0 has requirement setuptools>=41.0.0, but you'll have setuptools 40.2.0 which is incompatible. Installing collected packages: astor, absl-py, grpcio, termcolor, tensorflow-estimator, numpy, h5py, keras-applications, keras-preprocessing, opt-einsum, google-pasta, protobuf, wrapt, gast, markdown, werkzeug, tensorboard, tensorflow Found existing installation: numpy 1.15.4 Uninstalling numpy-1.15.4: Successfully uninstalled numpy-1.15.4 Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\Users\ALEXAN~1\AppData\Local\Temp\pip-uninstall-thxp7i_x\users\alexanderlee\appdata\roaming\python\python37\site-packages\numpy\.libs\libopenblas.csrrd7hkrkc3t3yxa7vy7tazglswdkw6.gfortran-win_amd64.dll' Consider using the --user option or check the permissions.

You are using pip version 10.0.1, however version 19.2.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

kieranrcampbell commented 4 years ago

I think you should be able to work through the above errors ^^

aaliakmal commented 4 years ago

So , how should I fix EnviromentalError. And should I install setuptools using pip

kieranrcampbell commented 4 years ago

If you read the error above you'll see

Consider using the --user option or check the permissions.

so I would start there (pip install --user tensorflow)

aaliakmal commented 4 years ago

Ok Here is Tensor flow configuration on R after installing Tensorflow 2.0 via anaconda

tensorflow::tf_config() TensorFlow v1.13.1 () Python v3.7 (C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate\python.exe)

Here is my anaconda code after running pip install --user tensorflow Installing collected packages: wrapt, h5py, keras-applications, setuptools, protobuf, werkzeug, markdown, tensorboard, opt-einsum, google-pasta, keras-preprocessing, gast, tensorflow The script markdown_py.exe is installed in 'C:\Users\alexanderlee\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. The script tensorboard.exe is installed in 'C:\Users\alexanderlee\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. The scripts saved_model_cli.exe, tensorboard.exe, tf_upgrade_v2.exe, tflite_convert.exe, toco.exe and toco_from_protos.exe are installed in 'C:\Users\alexanderlee\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed gast-0.2.2 google-pasta-0.1.7 h5py-2.10.0 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 opt-einsum-3.1.0 protobuf-3.10.0 setuptools-41.4.0 tensorboard-2.0.0 tensorflow-2.0.0 werkzeug-0.16.0 wrapt-1.11.2 You are using pip version 10.0.1, however version 19.2.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

kieranrcampbell commented 4 years ago

Okay your installation is almost certainly pointing to the wrong version of tensorflow as it still says 1.13.1 but you've just installed tensorflow 2. Can you restart R and as the first thing run

tensorflow::use_condaenv('r-reticulate')

(if this throws errors you might need to add a path, I don't know how it works on windows)

Make sure tensorflow::tf_config() shows version 2

then try re-installing cellassign?

aaliakmal commented 4 years ago

Tensorflow v.2.0 installed successfully. However installing cellassign still failed.

tensorflow::use_condaenv('r-reticulate')

tensorflow::tf_config() TensorFlow v2.0.0 () Python v3.7 (C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate\python.exe) devtools::install_github("Irrationone/cellassign") Downloading GitHub repo Irrationone/cellassign@master √ checking for file 'C:\Users\alexanderlee\AppData\Local\Temp\RtmpEfIPz6\remotes3da431e5ac3\Irrationone-cellassign-bded394/DESCRIPTION' (391ms)

  • preparing 'cellassign': √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • looking to see if a 'data/datalist' file should be added
  • building 'cellassign_0.99.12.tar.gz'
kieranrcampbell commented 4 years ago

Does vanilla tensorflow work? Ie if you run

tf <- tf$compat$v1
tf$disable_v2_behavior()
sess <- tf$Session()
ones <- tf$ones(5)
sess$run(ones)

does it run without error?

aaliakmal commented 4 years ago

On anaconda: (base) C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate>tf <- tf$compat$v1 The system cannot find the file specified.

(base) C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate>tf$disable_v2_behavior() 'tf$disable_v2_behavior' is not recognized as an internal or external command, operable program or batch file.

(base) C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate>sess <- tf$Session() The system cannot find the file specified.

(base) C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate>ones <- tf$ones(5) The system cannot find the file specified.

(base) C:\Users\alexanderlee\AppData\Local\Continuum\miniconda3\envs\r-reticulate>sess$run(ones)

On R-program e/cellassign_0.99.12.tar.gz’ had non-zero exit status

tf <- tf$compat$v1 Error: object 'tf' not found tf$disable_v2_behavior() Error: object 'tf' not found sess <- tf$Session() Error: object 'tf' not found ones <- tf$ones(5) Error: object 'tf' not found sess$run(ones) Error: object 'sess' not found

kieranrcampbell commented 4 years ago

You need to go into R and call library(tensorflow) before running what I proposed (in R)

aaliakmal commented 4 years ago

So here's what I got when running tensorflow and command you gave me.

library(tensorflow) tf <- tf$compat$v1 tf$disable_v2_behavior() WARNING: Logging before flag parsing goes to stderr. W1008 16:47:53.052414 21224 deprecation.py:323] From C:\Users\alexanderlee\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\compat\v2_compat.py:65: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term sess <- tf$Session() 2019-10-08 16:47:53.061453: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 ones <- tf$ones(5) sess$run(ones) [1] 1 1 1 1 1

VBRay commented 4 years ago

I had the same problem, Python 3.7 64 bit, Tensorflow 2.0, R 64 bit, @kieranrcampbell

here is my info: `reticulate::py_config() python: D:\Learning_Softwares\Python37\python.exe libpython: D:/Learning_Softwares/Python37/python37.dll pythonhome: D:\Learning_Softwares\Python37 version: 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)] Architecture: 64bit numpy: D:\Learning_Softwares\Python37\lib\site-packages\numpy numpy_version: 1.17.3 tensorflow: D:\Learning_Softwares\Python37\lib\site-packages\tensorflow__init__.p

python versions found: D:\Learning_Softwares\Python37\python.exe D:\Learning_Softwares\Python27\python.exe D:\Learning_Softwares\Python37\python.exe D:\Learning_Softwares\Anaconda3\python.exe D:\Learning_Softwares\Anaconda3\envs\PyTorch1.3\python.exe`

tensorflow::tf_config() TensorFlow v2.0.0 (D:\Learning_Softwares\Python37\lib\site-packages\tensorflow\__init__.p) Python v3.7 (D:\Learning_Softwares\Python37\python.exe)

`> tf$Session() Error in py_get_attr_impl(x, name, silent) : AttributeError: module 'tensorflow' has no attribute 'Session'

sess <- tf$Session() sess

`

> tf$disable_v2_behavior() Error in py_get_attr_impl(x, name, silent) : AttributeError: module 'tensorflow' has no attribute 'disable_v2_behavior'

`> devtools::install_github("Irrationone/cellassign") Downloading GitHub repo Irrationone/cellassign@master √ checking for file 'C:\Users\Ray\AppData\Local\Temp\RtmpiwMYY0\remotes12c469f47730\Irrationone-cellassign-12f3b5e/DESCRIPTION' ...

kieranrcampbell commented 4 years ago

Hi all

Could you try reinstalling cellassign via

devtools::install_github("LTLA/basilisk")
devtools::install_github("kieranrcampbell/cellassign")

? This uses the new basilisk package from Aaron Lun and I'm interested if it solves the build problems on windows. Thanks

mizzlefeng commented 4 years ago

I used this code devtools::install_github("LTLA/basilisk") devtools::install_github("kieranrcampbell/cellassign")

16-bit application is not supported. It is not compatible with 64-bit Windows. Is there a 64-bit compatible version?

LTLA commented 4 years ago

16 bit?! Where did that come from? Hope you're not trying to run R on Windows 3.1.

Seriously though, you should post the error log. I don't know about others here, but I'm not psychic, and I can't figure out whether the problem is with basilisk or not from your vague statement above.

3150129019 commented 4 years ago

error: Your current architecture is 32bit however this version of Python is compiled for 64bit. *** arch - x64 ERROR: loading failed for 'i386'

I solve the problems mentioned above via install_github("Irrationone/cellassign",INSTALL_opts="--no-multiarch") because it will not load 32bit and 64bit architecture at the same time.

TeodoraTockovska commented 2 years ago

Has anyone found a solution to this issue? I am having the same error trying to install cellassign. My current architecture is in 64bit (confirmed by following the solutions above and re-installing python, RStudio, and all required packages). Thanks!

NarainritKaruna commented 2 years ago

This worked install.packages("tensorflow") library(tensorflow) tensorflow::install_tensorflow(extra_packages='tensorflow-probability') devtools::install_github("Irrationone/cellassign",INSTALL_opts="--no-multiarch") library(cellassign)