althonos / pyhmmer

Cython bindings and Python interface to HMMER3.
https://pyhmmer.readthedocs.io
MIT License
129 stars 12 forks source link

ImportError: Cannot install pyhmmer in ubuntu #15

Closed yongjuntan closed 2 years ago

yongjuntan commented 2 years ago

Hi, I was trying to install pyhmmer in ubuntu. Because I have both python2 and 3 in ubuntu, I used below command to install it. It could download the package, but fail to install due to an import error: "ImportError: cannot import name 'errors'"

Could I known which additional package I need to install before pyhmmer installation?

Thanks for your help!

python3 -m pip install pyhmmer

Collecting pyhmmer
  Using cached https://files.pythonhosted.org/packages/65/f3/1de70443d58ccf843aaaa01393d640452e26b60912c0998302a0b8fea021/pyhmmer-0.4.11.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-1585x62q/pyhmmer/setup.py", line 636, in <module>
        sdist=sdist,
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.6/distutils/core.py", line 121, in setup
        dist.parse_config_files()
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 494, in parse_config_files
        ignore_option_errors=ignore_option_errors)
      File "/usr/lib/python3/dist-packages/setuptools/config.py", line 106, in parse_configuration
        meta.parse()
      File "/usr/lib/python3/dist-packages/setuptools/config.py", line 382, in parse
        section_parser_method(section_options)
      File "/usr/lib/python3/dist-packages/setuptools/config.py", line 355, in parse_section
        self[name] = value
      File "/usr/lib/python3/dist-packages/setuptools/config.py", line 173, in __setitem__
        value = parser(value)
      File "/usr/lib/python3/dist-packages/setuptools/config.py", line 430, in _parse_version
        version = self._parse_attr(value)
      File "/usr/lib/python3/dist-packages/setuptools/config.py", line 305, in _parse_attr
        module = import_module(module_name)
      File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 678, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/tmp/pip-build-1585x62q/pyhmmer/pyhmmer/__init__.py", line 19, in <module>
        from . import errors
    ImportError: cannot import name 'errors'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-1585x62q/pyhmmer/
althonos commented 2 years ago

Hi @yongjuntan , it looks like you are trying to install from an older Python version, so setuptools may not have all the required features I used to build the pyhmmer package. However, you should be able to use the pre-compiled wheel distributions.

Make sure you have the wheel package installed, and then try to install the pre-compiled package:

$ python3 -m pip install wheel
$ python3 -m pip install pyhmmer --only-binary pyhmmer

If this still doesn't work, then update setuptools, and retry building:

$ python3 -m pip install -U setuptools
$ python3 -m pip install pyhmmer
yongjuntan commented 2 years ago

Hi @althonos ,

Thanks for your answer. I have solved the problem after updating setuptools. And I checked my python version, it is 3.6.9, which is older than current one.

Thank you so much for your help!

althonos commented 2 years ago

Happy that it works!