diogomribeiro / sc_cop

Single cell local gene co-expression project
MIT License
0 stars 0 forks source link

`CODer.py` cannot import `util` #2

Closed jiangpuxuan closed 1 year ago

jiangpuxuan commented 1 year ago

When I ran CODer.py , it have the following error:

Traceback (most recent call last):
  File "/Array-Tuqiang/pxjiang/packages/sc_cop-main/CODer.py", line 15, in <module>
    from util.Logger import Logger
  File "/Array-Tuqiang/pxjiang/packages/sc_cop-main/util/Logger.py", line 6, in <module>
    from cod.util import Constants
ModuleNotFoundError: No module named 'cod.util'

Then I turned to CODer.py code:

from util.Logger import Logger
from util.Timer import Timer
from util.Stats import Stats

My python is 3.8.10 and it have python_utils instead of util packages. But python_utils does not seem to have util.Stats:


NAME
    python_utils

PACKAGE CONTENTS
    __about__
    compat
    converters
    decorators
    formatters
    import_
    logger
    terminal
    time

How could I run CODer.py with python_utils ? Or should we create a virtual environment for using CODer.py?

diogomribeiro commented 1 year ago

Hi, The "util" library refers to the local util folder available in this github repository (not an external library). If you have CODer.py and util in the same folder (i.e. clone the repository) this should work. You can also try adding the path to the PYTHONPATH variable. Hope this helps, Diogo

jiangpuxuan commented 1 year ago

Hi, The "util" library refers to the local util folder available in this github repository (not an external library). If you have CODer.py and util in the same folder (i.e. clone the repository) this should work. You can also try adding the path to the PYTHONPATH variable. Hope this helps, Diogo

Thank you for your help !

jiangpuxuan commented 1 year ago

Hi, The "util" library refers to the local util folder available in this github repository (not an external library). If you have CODer.py and util in the same folder (i.e. clone the repository) this should work. You can also try adding the path to the PYTHONPATH variable. Hope this helps, Diogo

I check my directory and the "util" library is right there. But where could I find cod.util ?

Traceback (most recent call last):
  File "/Array-Tuqiang/pxjiang/packages/sc_cop-main/CODer.py", line 15, in <module>
    from util.Logger import Logger
  File "/Array-Tuqiang/pxjiang/packages/sc_cop-main/util/Logger.py", line 6, in <module>
    from cod.util import Constants
ModuleNotFoundError: No module named 'cod.util'
1678802344824
diogomribeiro commented 1 year ago

Thanks for ponting this out, some paths were outdated. I have fixed this and pushed the changes, if you git pull it should work now. By the way, I have added a test input matrix that can serve as example on test/test_expression_matrix_chr21_chr18.bed

Cheers, Diogo