Closed rbutleriii closed 2 months ago
This is more simply reproducible by trying to load it directly with:
library(reticulate, quietly = TRUE)
rootdir = '/labs/flongo/Tau-PS19_C31_cortex_snRNAseq'
wk_dir = paste0(rootdir, '/liana')
use_condaenv("c2c") # same result with
tensorly <- reticulate::import('tensorly')
c2c <- reticulate::import(module = "cell2cell")
Error in py_module_import(module, convert = convert) :
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Run `reticulate::py_last_error()` for details.
Running it out, we see:
> reticulate::py_last_error()
── Python Exception Message ────────────────────────────────────────────────────────────────────────────────────────────
Traceback (most recent call last):
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 93, in _run_hook
module = hook()
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 117, in _hook
return _find_and_load(name, import_)
File "/oak/stanford/scg/lab_flongo/Tau-PS19_C31_cortex_snRNAseq/liana/c2c/lib/python3.10/site-packages/cell2cell/__init__.py", line 3, in <module>
from cell2cell import analysis
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 93, in _run_hook
module = hook()
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 117, in _hook
return _find_and_load(name, import_)
File "/oak/stanford/scg/lab_flongo/Tau-PS19_C31_cortex_snRNAseq/liana/c2c/lib/python3.10/site-packages/cell2cell/analysis/__init__.py", line 1, in <module>
from cell2cell.analysis.cell2cell_pipelines import (initialize_interaction_space, BulkInteractions, SingleCellInteractions)
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 93, in _run_hook
module = hook()
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 117, in _hook
return _find_and_load(name, import_)
File "/oak/stanford/scg/lab_flongo/Tau-PS19_C31_cortex_snRNAseq/liana/c2c/lib/python3.10/site-packages/cell2cell/analysis/cell2cell_pipelines.py", line 6, in <module>
import scanpy
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 93, in _run_hook
module = hook()
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 117, in _hook
return _find_and_load(name, import_)
File "/home/rrbutler/.local/lib/python3.10/site-packages/scanpy/__init__.py", line 16, in <module>
from . import plotting as pl
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 93, in _run_hook
module = hook()
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 117, in _hook
return _find_and_load(name, import_)
File "/home/rrbutler/.local/lib/python3.10/site-packages/scanpy/plotting/__init__.py", line 1, in <module>
from ._anndata import (
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 93, in _run_hook
module = hook()
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 117, in _hook
return _find_and_load(name, import_)
File "/home/rrbutler/.local/lib/python3.10/site-packages/scanpy/plotting/_anndata.py", line 28, in <module>
from . import _utils
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 93, in _run_hook
module = hook()
File "/home/rrbutler/R/x86_64-pc-linux-gnu-library/4.2/reticulate/python/rpytools/loader.py", line 117, in _hook
return _find_and_load(name, import_)
File "/home/rrbutler/.local/lib/python3.10/site-packages/scanpy/plotting/_utils.py", line 35, in <module>
class _AxesSubplot(Axes, axes.SubplotBase, ABC):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
── R Traceback ─────────────────────────────────────────────────────────────────────────────────────────────────────────
▆
1. └─reticulate::import(module = "cell2cell")
2. └─reticulate:::py_module_import(module, convert = convert)
I suppose this may be an issue for cell2cell
? tried it with 0.7.2 and updating to latest.
Closing this and moving the issue to cell2cell -> https://github.com/earmingol/cell2cell/issues/55
I am running into an error I haven't seen right at the liana_tensor_c2c step in my script:
Not sure if this is an issue with the conda env I built or how it is called. It was built using the
env_python_gpu.yml
from ccc_protocols in a specific location (too huge to fit in my cluster's home folder allocation).In the script, I specify the
RETICULATE_PYTHON
variable, and pass the env name and setuse_available = TRUE
. This might be confusing things, as outside R the environment is activated before starting.