Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

ImportError: cannot import name 'Fasta' from 'fasta' #15

Open
evabalini opened this issue Jan 27, 2022 · 6 comments
Open

ImportError: cannot import name 'Fasta' from 'fasta' #15

evabalini opened this issue Jan 27, 2022 · 6 comments

Comments

@evabalini
Copy link

Hello,

Only by importing biovec, I get this error:

ImportError                               Traceback (most recent call last)
/var/folders/93/lz6gxd9906z7wqwc1tx7hgsc0000gn/T/ipykernel_1486/1815076386.py in <module>
----> 1 import biovec
      2 
      3 pv = biovec.models.ProtVec("some_fasta_file.fasta", corpus_fname="output_corpusfile_path.txt", n=3)

~/miniconda3/envs/myenv/lib/python3.7/site-packages/biovec/__init__.py in <module>
----> 1 from biovec import models

~/miniconda3/envs/myenv/lib/python3.7/site-packages/biovec/models/__init__.py in <module>
----> 1 from biovec.models.prot_vec import *

~/miniconda3/envs/myenv/lib/python3.7/site-packages/biovec/models/prot_vec.py in <module>
      1 from gensim.models import word2vec
----> 2 from biovec.utils import *
      3 
      4 
      5 def load_protvec(model_fname):

~/miniconda3/envs/myenv/lib/python3.7/site-packages/biovec/utils.py in <module>
----> 1 from pyfasta import Fasta
      2 from tqdm import tqdm
      3 
      4 
      5 def split_ngrams(seq, n):

~/miniconda3/envs/myenv/lib/python3.7/site-packages/pyfasta/__init__.py in <module>
      1 from __future__ import print_function
      2 import sys
----> 3 from fasta import Fasta, complement, DuplicateHeaderException
      4 from records import *
      5 from split_fasta import split

ImportError: cannot import name 'Fasta' from 'fasta' (/Users/evabalini/miniconda3/envs/myenv/lib/python3.7/site-packages/fasta/__init__.py)```

I am not sure if this is a version/dependency problem or something else. 

Kind regards, 
Eva 
@nwoyto
Copy link

nwoyto commented Oct 25, 2022

Hey Eva, I am getting the same error when importing biovec... any chance you figured it out ?

@evabalini
Copy link
Author

Hey Eva, I am getting the same error when importing biovec... any chance you figured it out ?

Unfortunately I left it like that and did what I wanted with bio_embeddings.

@nwoyto
Copy link

nwoyto commented Oct 25, 2022

Ah okay thank you!
@kyu999 any insight here?

@kyu999
Copy link
Owner

kyu999 commented Oct 26, 2022

I will check it!
thanks!

@xorJane
Copy link

xorJane commented Jan 12, 2023

I ran into the same issue and found that changing from pyfasta to pyfaidx resolved the error messages at import. I hope this helps!

@Amitranjan71
Copy link

Amitranjan71 commented May 11, 2023

I ran into the same issue and found that changing from pyfasta to pyfaidx resolved the error messages at import. I hope this helps!

~/miniconda3/envs/myenv/lib/python3.7/site-packages/biovec/utils.py in
----> 1 from pyfasta import Fasta

just changed 'from pyfasta import Fasta' to 'from pyfaidx import Fasta'
Worked for me :)
Thanks!

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

No branches or pull requests

5 participants