dmmiller612 / bert-extractive-summarizer

Easy to use extractive text summarization with BERT
MIT License
1.39k stars 307 forks source link

cannot import name 'summarize' #41

Open shuntera opened 4 years ago

shuntera commented 4 years ago

After using pip install and going into my Python 3.8 shell, if I enter:

from summarizer import Summarizer

I get the error:

ImportError: cannot import name 'summarize' from partially initialized module 'summarizer' (most likely due to a circular import)

dmmiller612 commented 4 years ago

Hello Shuntera,

I would verify that the module is correct. We frequently get issues around wrong imports of the summarizer (there is another package that also has a package summarize).

usamahameedx commented 3 years ago

I am also getting same Error

ImportError: cannot import name 'BartModel' from 'transformers' (/usr/local/lib/python3.7/dist-packages/transformers/init.py)

bnaismith commented 2 years ago

I am also getting same Error

ImportError: cannot import name 'BartModel' from 'transformers' (/usr/local/lib/python3.7/dist-packages/transformers/init.py)

I am also getting the same error message, but only after updating my Mac OS to Monterey, so I'm guessing it's related to that. Trying different things, but no luck yet.

dmmiller612 commented 2 years ago

Note the two errors above are different than the original message. The errors above are related to the transformers package. What version of transformers are you running?

bnaismith commented 2 years ago

Apologies, you're right - I was only responding to the comment, not the original post. I am using the updated transformers, version 4.15

J-E-J-S commented 2 years ago

Seems likely that @shuntera might have named the file summarizer.py which will cause problem with imports. See https://stackoverflow.com/questions/64807163/importerror-cannot-import-name-from-partially-initialized-module-m. Try rename the file to somthing different if this is the case.