Teichlab / cellphonedb

MIT License
345 stars 105 forks source link

Error when using plot function #381

Open FionaMoon opened 2 years ago

FionaMoon commented 2 years ago

Hi all, I met a strange problem which never exists before. Every time I run cellphonedb plot heatmap_plot, I'll get errors like this

Warning message:
In options(stringsAsFactors = TRUE) :
  'options(stringsAsFactors = TRUE)' is deprecated and will be disabled
Error: package or namespace load failed for ‘methods’:
 .onLoad failed in loadNamespace() for 'methods', details:
  call: assign(".methodsNamespace", where, baseenv())
  error: cannot add binding of '.methodsNamespace' to the base environment
Error: package or namespace load failed for ‘datasets’:
 .onLoad failed in loadNamespace() for 'methods', details:
  call: assign(".methodsNamespace", where, baseenv())
  error: cannot add binding of '.methodsNamespace' to the base environment
Error: package or namespace load failed for ‘utils’:
 .onLoad failed in loadNamespace() for 'methods', details:
  call: assign(".methodsNamespace", where, baseenv())
  error: cannot add binding of '.methodsNamespace' to the base environment
Error: package or namespace load failed for ‘grDevices’:
 .onLoad failed in loadNamespace() for 'methods', details:
  call: assign(".methodsNamespace", where, baseenv())
  error: cannot add binding of '.methodsNamespace' to the base environment
Error: package or namespace load failed for ‘graphics’:
 .onLoad failed in loadNamespace() for 'methods', details:
  call: assign(".methodsNamespace", where, baseenv())
  error: cannot add binding of '.methodsNamespace' to the base environment
Error: package or namespace load failed for ‘stats’:
 .onLoad failed in loadNamespace() for 'methods', details:
  call: assign(".methodsNamespace", where, baseenv())
  error: cannot add binding of '.methodsNamespace' to the base environment
Error: package or namespace load failed for ‘methods’:
 .onLoad failed in loadNamespace() for 'methods', details:
  call: assign(".methodsNamespace", where, baseenv())
  error: cannot add binding of '.methodsNamespace' to the base environment
During startup - Warning messages:
1: package "methods" in options("defaultPackages") was not found 
2: package ‘datasets’ in options("defaultPackages") was not found 
3: package ‘utils’ in options("defaultPackages") was not found 
4: package ‘grDevices’ in options("defaultPackages") was not found 
5: package ‘graphics’ in options("defaultPackages") was not found 
6: package ‘stats’ in options("defaultPackages") was not found 
7: package ‘methods’ in options("defaultPackages") was not found 
Error: .onLoad failed in loadNamespace() for 'methods', details:
  call: assign(".methodsNamespace", where, baseenv())
  error: cannot add binding of '.methodsNamespace' to the base environment
Fatal error: unable to initialize the JIT

Any suggestions for me? Thank you inadvance!

prete commented 2 years ago

Hi @FionaMoon, thank you for using CellPhoneDB. Could you please let us know which version of R (R --version) and which version of rpy2 (pip show rpy2) do you have installed on your environment?

FionaMoon commented 2 years ago

Hi prete, My R version is

R version 4.1.3 (2022-03-10) -- "One Push-Up"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-conda-linux-gnu (64-bit)

My rpy2 version is

pip show rpy2
Name: rpy2
Version: 3.5.2
Summary: Python interface to the R language (embedded R)
Home-page: https://rpy2.github.io
Author: Laurent Gautier
Author-email: lgautier@gmail.com
License: GPLv2+
Location: /xtdisk/miniconda/envs/cpdb/lib/python3.8/site-packages
Requires: cffi, jinja2, pytz, tzlocal
Required-by: CellPhoneDB

Thank you for your help!

FionaMoon commented 2 years ago

And it seems have another problem like in #363, markupsafe need to be downgrading. If I don't do this I 'll got error:

ImportError: cannot import name 'soft_unicode' from 'markupsafe'
mostafaismail11 commented 2 years ago

I have the error of cannot import name 'soft_unicode' from 'markupsafe' what should i do ?

prete commented 2 years ago

pip install -U markupsafe<=2.0.1 should solve your markupsafe issue