scverse / scanpy

Single-cell analysis in Python. Scales to >1M cells.
https://scanpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.87k stars 594 forks source link

ImportError: Please install skmisc package via `pip install --user scikit-misc #2352

Closed w1973145618 closed 4 months ago

w1973145618 commented 1 year ago

Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Minimal code sample (that we can copy&paste without having any data)

import scanpy as sc
adata = sc.read_csv(dir + 'GSM5226574_C51ctr_raw_counts.csv.gz').T
import scvi 
sc.pp.filter_genes(adata, min_cells = 10)
sc.pp.highly_variable_genes(adata, n_top_genes = 2000, subset = True, flavor = 'seurat_v3')
>>> sc.pp.highly_variable_genes(adata, n_top_genes = 2000, subset = True, flavor = 'seurat_v3')
Traceback (most recent call last):
  File "D:\Anaconda3\ana\envs\scvi\lib\site-packages\scanpy\preprocessing\_highly_variable_genes.py", line 53, in _highly_variable_genes_seurat_v3
    from skmisc.loess import loess
  File "D:\pycharm\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\skmisc\loess\__init__.py", line 51, in <module>
    from ._loess import (loess, loess_model, loess_inputs, loess_control,
  File "D:\pycharm\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed while importing _loess: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "D:\Anaconda3\ana\envs\scvi\lib\site-packages\IPython\core\interactiveshell.py", line 3378, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-22-92878e4bd6f9>", line 1, in <module>
    sc.pp.highly_variable_genes(adata, n_top_genes = 2000, subset = True, flavor = 'seurat_v3')
  File "D:\Anaconda3\ana\envs\scvi\lib\site-packages\scanpy\preprocessing\_highly_variable_genes.py", line 422, in highly_variable_genes
    return _highly_variable_genes_seurat_v3(
  File "D:\Anaconda3\ana\envs\scvi\lib\site-packages\scanpy\preprocessing\_highly_variable_genes.py", line 55, in _highly_variable_genes_seurat_v3
    raise ImportError(
ImportError: Please install skmisc package via `pip install --user scikit-misc

Versions

scanpy 1.9.1 [Paste the output of scanpy.logging.print_versions() leaving a blank line after the details tag]

I don't know how to deal with this problem

Zethson commented 1 year ago

Is this issue still relevant? Did you install scikit-misc?

eroell commented 4 months ago

Doing pip install --user scikit-misc as the last line says should solve this issue - I hope it worked out! Will close this as no more followups seen here.

xiaosu-beep commented 1 day ago

请问你解决了嘛,我也遇到了相同的问题