[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting an error in scanpy after 'successfully' installing it through anaconda prompt #587

Closed
koalap-2018 opened this issue Apr 3, 2019 · 7 comments

Comments

@koalap-2018
Copy link
koalap-2018 commented Apr 3, 2019

this is what i get after running import scanpy as sc

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-0074c9bc0b31> in <module>()
----> 1 import scanpy as sc

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scanpy\__init__.py in <module>()
      1 # some technical stuff
      2 import sys
----> 3 from .utils import check_versions, annotate_doc_types
      4 from ._version import get_versions  # version generated by versioneer
      5 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scanpy\utils.py in <module>()
     16 
     17 from . import settings
---> 18 from . import logging as logg
     19 
     20 EPS = 1e-15

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scanpy\logging.py in <module>()
      4 import time as time_module
      5 import datetime
----> 6 from anndata import logging
      7 from . import settings
      8 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\anndata\__init__.py in <module>()
----> 1 from .base import AnnData
      2 from .readwrite import (
      3     read_h5ad, read_loom, read_hdf,
      4     read_excel, read_umi_tools,
      5     read_csv, read_text, read_mtx,

~\AppData\Local\Continuum\anaconda3\lib\site-packages\anndata\base.py in <module>()
     40             return 'mock zappy.base.ZappyArray'
     41 
---> 42 from . import h5py
     43 from .layers import AnnDataLayers
     44 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\anndata\h5py\__init__.py in <module>()
     22    SparseDataset
     23 """
---> 24 from .h5sparse import File, Group, SparseDataset, _load_h5_dataset_as_sparse
     25 from h5py import Dataset, special_dtype
     26 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\anndata\h5py\h5sparse.py in <module>()
      5 
      6 import six
----> 7 import h5py
      8 import numpy as np
      9 import scipy.sparse as ss

~\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py\__init__.py in <module>()
     34 _errors.silence_errors()
     35 
---> 36 from ._conv import register_converters as _register_converters
     37 _register_converters()
     38 

h5py\h5r.pxd in init h5py._conv()

h5py\_objects.pxd in init h5py.h5r()

h5py\_objects.pyx in init h5py._objects()

ImportError: DLL load failed: The specified procedure could not be found.
@koalap-2018
Copy link
Author

My operating system is windows 10. Appreciate all the help!

@ivirshup
Copy link
Member
ivirshup commented Apr 4, 2019

Could you provide some version information on your conda environment? Pretty much the output of conda list

@ivirshup
Copy link
Member
ivirshup commented Apr 4, 2019

But also, that looks like an h5py issue. Do you still get the error if you try import h5py in that environment?

@koalap-2018
Copy link
Author
koalap-2018 commented Apr 4, 2019

Hi! Thanks for the answer. Installing and importing h5py helped. I think I got scanpy to run. However, I am stuck again at reading the .mtx file

Since I am new to scanpy I am just following your tutorial. I run the following comand and get the subsequent error bellow.

adata = sc.read_10x_mtx(
    'C:\\Users\\correap\\Documents\\03152019_scRNAseq\\filtered_feature_bc_matrix_1',  # the directory with the `.mtx` file
    var_names='gene_symbols',                  # use gene symbols for the variable names (variables-axis index)
    cache=True)                                # write a cache file for faster subsequent reading
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-17-e7dd3543f8df> in <module>()
      2     'C:\\Users\\correap\\Documents\\03152019_scRNAseq\\filtered_feature_bc_matrix_1',  # the directory with the `.mtx` file
      3     var_names='gene_symbols',                  # use gene symbols for the variable names (variables-axis index)
----> 4     cache=True)                                # write a cache file for faster subsequent reading
      5 
      6 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scanpy\readwrite.py in read_10x_mtx(path, var_names, make_unique, cache, gex_only)
    244     else:
    245         adata = _read_v3_10x_mtx(path, var_names=var_names,
--> 246                                  make_unique=make_unique, cache=cache)
    247         if not gex_only:
    248             return adata

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scanpy\readwrite.py in _read_v3_10x_mtx(path, var_names, make_unique, cache)
    277     Read mex from output from Cell Ranger v3 or later versions
    278     """
--> 279     adata = read(os.path.join(path, 'matrix.mtx.gz'), cache=cache).T  # transpose the data
    280     genes = pd.read_csv(os.path.join(path, 'features.tsv.gz'), header=None, sep='\t')
    281     if var_names == 'gene_symbols':

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scanpy\readwrite.py in read(filename, backed, sheet, ext, delimiter, first_column_names, backup_url, cache, **kwargs)
     76         return _read(filename, backed=backed, sheet=sheet, ext=ext,
     77                      delimiter=delimiter, first_column_names=first_column_names,
---> 78                      backup_url=backup_url, cache=cache, **kwargs)
     79     # generate filename and read to dict
     80     filekey = filename

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scanpy\readwrite.py in _read(filename, backed, sheet, ext, delimiter, first_column_names, backup_url, cache, suppress_cache_warning, **kwargs)
    447     else:
    448         if not is_present:
--> 449             raise FileNotFoundError('Did not find file {}.'.format(filename))
    450         logg.msg('reading', filename, v=4)
    451         if not cache and not suppress_cache_warning:

FileNotFoundError: Did not find file C:\Users\correap\Documents\03152019_scRNAseq\filtered_feature_bc_matrix_1\matrix.mtx.gz.

​My filtered_feature_bc_matrix_1 contains the folders barcodes.tsv, gene_symbols.tsv (manually changed to this from default 10X output of genes) and the matrix.mtx file. I could manually change the matrix.mtx to matrix.mtx.gz. but this might corrupt the file and not be very good practice in the future. Any solutions to these different formats???

Also, if you could provide the ling to a manual or a documentation written for scanpy that would be great.

@ivirshup
Copy link
Member
ivirshup commented Apr 5, 2019

Here's a link to the docs https://scanpy.readthedocs.io/, it's also available at the top of the github repo.

EDIT: Whoops, posted some wrong info about how 10x pre v3 datasets are read before.

@koalap-2018
Copy link
Author

I got through by importing a csv and reading it that way. Thanks for the link!

@ivirshup ivirshup closed this as completed Jul 7, 2019
@paupaiz
Copy link
paupaiz commented Jul 21, 2022

I am still getting the file not found error because when downloading it's lacking the gz extension. Will manually change but sharing so you are aware! @ivirshup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants