timoast / sinto

Tools for single-cell data processing
https://timoast.github.io/sinto/
MIT License
118 stars 25 forks source link

Potential naming issue with import of importlib-metadata package #53

Closed tilofrei closed 2 years ago

tilofrei commented 2 years ago

Hi Tim, when loading your package in python I ran into an error:

>>> import sinto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/user/conda/envs/sinto/lib/python3.7/site-packages/sinto/__init__.py", line 1, in <module>
import importlib.metadata
ModuleNotFoundError: No module named 'importlib.metadata'

Then I noticed in my installation the package is called envs/sinto/lib/python3.7/site-packages/importlib_metadata (with an underscore instead of a dot). So changing import.metadata to import_metadata in conda/pkgs/sinto-0.8.1-pyhfa5458b_0/site-packages/sinto/__init__.py resolves the error. Maybe this is a version specific naming?

Thanks! Tilo

My conda environment:

timoast commented 2 years ago

importlib_metadata is a different package, importlib.metadata is included in python >=3.8. The issue here is I didn’t set the minimum python version requirement, it should be 3.8. I will add that to setup.cfg, in the meantime installing python >=3.8 should solve this issue.

tilofrei commented 2 years ago

Oh, thanks! That worked for me.

bellenger-l commented 1 year ago

Hello !

I encounter the same issue when I use conda to install sinto. Even if it installs the version 0.9.0 by default, I had to specify the python version to overcome this error (and another error appears later so I also specified to install cython which seems to be required by pysam).

In order to have a functional conda environment, I had to run the following command :

conda create -n sinto_env python=3.8 sinto cython

Thanks for this tool, I can't wait to test it. Best Lea