How to fix ModuleNotFoundError: No module named 'skmisc'?

Hi all,

After running as instruction message I still got error:

pip install --user scikit-misc

sc.pp.highly_variable_genes(adata, n_top_genes = 2000, subset = True, flavor = 'seurat_v3')

ModuleNotFoundError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/scanpy/preprocessing/_highly_variable_genes.py in _highly_variable_genes_seurat_v3(adata, layer, n_top_genes, batch_key, check_values, span, subset, inplace) 52 try: —> 53 from skmisc.loess import loess 54 except ImportError:

ModuleNotFoundError: No module named ‘skmisc’

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last) 2 frames /usr/local/lib/python3.7/dist-packages/scanpy/preprocessing/_highly_variable_genes.py in _highly_variable_genes_seurat_v3(adata, layer, n_top_genes, batch_key, check_values, span, subset, inplace) 54 except ImportError: 55 raise ImportError( —> 56 ‘Please install skmisc package via `pip install --user scikit-misc’ 57 ) 58 df = pd.DataFrame(index=adata.var_names)

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


NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the

“Open Examples” button below.

The code is from: sanbomics_scripts/single_cell_analysis_complete_class.ipynb at main · mousepixels/sanbomics_scripts · GitHub

Thank you so much!

How did you solve this issue? having the same problem

Perhaps just try pip install skmisc? or if you’re in a conda environment conda install -c conda-forge scikit-misc

1 Like

No luck with any of those options. I keep getting the same error. It’s driving me crazy because I can run it well on google colab.

Output exceeds the size limit. Open the full output data in a text editor

ImportError Traceback (most recent call last)
File c:\Users\user\miniconda3\lib\site-packages\scanpy\preprocessing_highly_variable_genes.py:53, in _highly_variable_genes_seurat_v3(adata, layer, n_top_genes, batch_key, check_values, span, subset, inplace)
52 try:
—> 53 from skmisc.loess import loess
54 except ImportError:

File ~\AppData\Roaming\Python\Python39\site-packages\skmisc\loess_init_.py:51
1 “”"
2 =================================================
3 Locally-weighted regression (:mod:skmisc.loess)
(…)
49 pp. 829–836. 1979.
50 “”"
—> 51 from ._loess import (loess, loess_model, loess_inputs, loess_control,
52 loess_outputs, loess_prediction,
53 loess_confidence_intervals, loess_anova)
56 all = [‘loess’, ‘loess_model’, ‘loess_control’, ‘loess_inputs’,
57 ‘loess_model’, ‘loess_outputs’, ‘loess_prediction’,
58 ‘loess_confidence_intervals’, ‘loess_anova’]

ImportError: DLL load failed while importing _loess: The specified module could not be found.

During handling of the above exception, another exception occurred:

57 )
58 df = pd.DataFrame(index=adata.var_names)
59 X = adata.layers[layer] if layer is not None else adata.X

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

I didn’t use Scanpy for a few months so not sure what I did. I got several errors when using Scanpy. Try to uninstall the package and reinstall it. It worked for one of the errors I got.

Hello , I have the same issue . How did u solve it please ?