How to fix ModuleNotFoundError: No module named 'skmisc'?
2
0
Entering edit mode
18 months ago
Chris ▴ 260

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: https://github.com/mousepixels/sanbomics_scripts/blob/main/single_cell_analysis_complete_class.ipynb

Thank you so much!

skmisc • 3.1k views
ADD COMMENT
1
Entering edit mode
18 months ago
Mensur Dlakic ★ 27k

Depending on how your system is set up, this command pip install --user scikit-misc could be installing the package for Python v2, while your program needs Python v3. I suggest you try the same command but type pip3 instead.

ADD COMMENT
0
Entering edit mode

Thanks Mensur! It still gives me the same error message. I run on Google colab.

ADD REPLY
1
Entering edit mode
10 months ago
Kehan Ren ▴ 10

I ran into this error as well and solved it by restarting the kernel.

After restart the kernel, you need to type in the command all over again (except installing the packages you had already installed)

Hope this helps.

Kehan

ADD COMMENT
0
Entering edit mode

It was 8 months ago so I don't remember if I resolve the error but thank you!

ADD REPLY
0
Entering edit mode

This worked for me. After "pip install --user scikit-misc", I restarted the kernel and it worked

ADD REPLY

Login before adding your answer.

Traffic: 1852 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6