Closed zoan128 closed 10 months ago
pak::pak("rstudio/reticulate")
This problem caused by "reticulate". You can use pak update reticulate, and this issue should be solved.
As someone who doesn’t know python at all, python environment configuration took me a whole day. Fortunately, python and R are similar, otherwise I wouldn’t know how to solve those errors.
This issue is caused by reticulate. You need to install the development version of reticulate. https://community.rstudio.com/t/problem-with-tensorflow-2-10-and-rstudio/173917/4
I encoutered an error when I do "ref_data <- srt_to_adata(ref)" and "ref" is a seuratobject.
**My code :
prepare
if (!require("devtools", quietly = TRUE)) { install.packages("devtools") } devtools::install_github("zhanghao-njmu/SCP") SCP::PrepareEnv() library(SCP)
convert
ref <- readRDS("E:/ewdata/CRJdataanalysis/analysis/Chai_ref.rds")
ref_data <- srt_to_adata(ref)**
Reticulate::py_last_error() shows:
── Python Exception Message ───────────────────────────────────────────────────────────────────── Traceback (most recent call last): File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook return _run_hook(name, _hook) File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook module = hook() File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook return _find_andload(name, import) File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\scanpy__init.py", line 14, in
from . import tools as tl
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\scanpy\tools__init.py", line 1, in
from ..preprocessing import pca
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\scanpy\preprocessing__init.py", line 1, in
from ._recipes import recipe_zheng17, recipe_weinreb17, recipe_seurat
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\scanpy\preprocessing_recipes.py", line 12, in
from ._normalization import normalize_total
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\scanpy\preprocessing_normalization.py", line 7, in
from sklearn.utils import sparsefuncs
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\sklearn__init.py", line 82, in
from .base import clone
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\sklearn\base.py", line 17, in
from .utils import _IS_32BIT
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\sklearn\utils\ init.py", line 29, in
from .fixes import parse_version, threadpool_info
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\sklearn\utils\fixes.py", line 19, in
import scipy.stats
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\scipy\stats\ init__.py", line 485, in
from ._stats_py import *
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\scipy\stats_stats_py.py", line 37, in
from numpy.testing import suppress_warnings
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\site-packages\numpy\testing\ init__.py", line 8, in
from unittest import TestCase
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\unittest\ init.py", line 60, in
from .async_case import IsolatedAsyncioTestCase
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\unittest\async_case.py", line 1, in
import asyncio
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "E:\R-4.3.1\library\reticulate\python\rpytools\loader.py", line 117, in _hook
return _find_andload(name, import)
File "C:\Users\Lenovo\AppData\Local\R-MINI~1\envs\SCP_env\lib\asyncio\ init.py", line 26, in
all__ = (base_events. all__ +
NameError: name 'base_events' is not defined
── R Traceback ────────────────────────────────────────────────────────────────────────────────── ▆