LooseLab / readfish

CLI tool for flexible and fast adaptive sampling on ONT sequencers
https://looselab.github.io/readfish/
GNU General Public License v3.0
169 stars 33 forks source link

readfish dev installation issue #167

Closed Huanle closed 2 years ago

Huanle commented 2 years ago

Hi readfish authors,

Thanks for developing readfish.

I tried to install the dev version following steps below:

python3.7 -m venv rf_dev_venv 
. rf_dev_venv/bin/activate
pip install --upgrade pip

pip install git+https://github.com/nanoporetech/read_until_api@v3.0.0
pip install git+https://github.com/LooseLab/readfish@dev

pip install ont_pyguppy_client_lib==5.0.16 # 5.0.16 is the version of guppy_server i am using

The installation ended with no error. But I ran into the error below when trying to call readfish

$ readfish

Traceback (most recent call last):
  File "/home/test/lhl/sw/readfish_py37/bin/readfish", line 11, in <module>
    load_entry_point('readfish==0.0.8a1', 'console_scripts', 'readfish')()
  File "/home/test/lhl/sw/readfish_py37/lib/python3.7/site-packages/ru/cli.py", line 35, in main
    _module = importlib.import_module("ru.{}".format(module))
  File "/home/test/lhl/sw/Python-3.7.9/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/test/lhl/sw/readfish_py37/lib/python3.7/site-packages/ru/ru_gen.py", line 19, in <module>
    from ru.arguments import BASE_ARGS
  File "/home/test/lhl/sw/readfish_py37/lib/python3.7/site-packages/ru/arguments.py", line 7, in <module>
    from ru.utils import nice_join
  File "/home/test/lhl/sw/readfish_py37/lib/python3.7/site-packages/ru/utils.py", line 735, in <module>
    def get_barcode_kits(address, timeout=10000):
  File "/home/test/lhl/sw/Python-3.7.9/lib/python3.7/functools.py", line 490, in lru_cache
    raise TypeError('Expected maxsize to be an integer or None')
TypeError: Expected maxsize to be an integer or None

Can you help to figure out what's going wrong? Thanks a lot.

alexomics commented 2 years ago

I've pushed a fix to an issue branch that should resolve this problem. You can test this out by re-installing readfish in your virtual environment like so:

pip uninstall -y readfish && pip install git+https://github.com/LooseLab/readfish@issue167

If this resolves the error, let me know and I will merge this into dev asap.

Huanle commented 2 years ago

Hi @alexomics , thanks a lot. It does resolve the error. Can you let me know what happened?

alexomics commented 2 years ago

Yes! In python >=3.8 the functools.lru_cache doesn't need to be called, in python <=3.7 it still requires instantiation (by adding () at the end of the decorator). Commit 881c2ca adds the parentheses in to make it compatible with python 3.7 again.

Huanle commented 2 years ago

thanks a lot @alexomics for your help.