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

Does not work for Python 3.10 #52

Open
january3 opened this issue May 3, 2023 · 2 comments
Open

Does not work for Python 3.10 #52

january3 opened this issue May 3, 2023 · 2 comments

Comments

@january3
Copy link

january3 commented May 3, 2023

Trying to run gtf2bed from GFFUtils, release v. 0.12.0, with Python 3.10 which I have in my conda environment, results in the following error:

$ gtf2bed -h
Traceback (most recent call last):
  File "/XXX/bin/gtf2bed", line 5, in <module>
    from GFFUtils.cli.gtf2bed import main
  File "/ZZZ/lib/python3.10/site-packages/GFFUtils/cli/gtf2bed.py", line 9, in <module>
    from ..GTFFile import GTFIterator
  File "/ZZZ/lib/python3.10/site-packages/GFFUtils/GTFFile.py", line 83, in <module>
    from .GFFFile import GFFFile
  File "/ZZZ/lib/python3.10/site-packages/GFFUtils/GFFFile.py", line 93, in <module>
    from collections import Iterator
ImportError: cannot import name 'Iterator' from 'collections' (/ZZZ/lib/python3.10/collections/__init__.py)
@pjbriggs
Copy link
Member

pjbriggs commented May 5, 2023

Hello @january3 sorry you've encountered a problem with this package. I'm doing minimal support for GFFUtils now, as it doesn't seem to be used much and other projects are taking up most of my time these days.

As you say that you're using conda, you might consider trying the gtf2bed utility provided by the BEDOPS package instead - this can be installed directly into a conda environment using e.g. conda install -c bioconda bedops (see https://anaconda.org/bioconda/bedops - the BEDOPS documentation can be found at https://bedops.readthedocs.io/en/latest/index.html).

Alternatively if you wanted to persevere with GFFUtils (and are confident with editing the Python source code) then I think you would need to edit the import of Iterator in GFFUtils/GFFFile.py to be:

from collections.abc import Iterator

and then reinstall. However I haven't had an opportunity to test this out yet, so if you did take this approach then please let me know how you get on.

Otherwise if it is very important than I can take a look next week at trying to update the package so that it works with more up-to-date Python.

Sorry not to be more helpful right now - good luck!

@kubu4
Copy link

kubu4 commented May 23, 2024

@january3

Create a new conda/mamba environment and specify using Python v3:

conda create --name gffutils-0.12.0_env python=3.9

Then, follow the remainder of the installation instructions for GFFUtils.

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

No branches or pull requests

3 participants