keras-text-summarization icon indicating copy to clipboard operation
keras-text-summarization copied to clipboard

No module named 'keras_text_summarization'

Open avinsit123 opened this issue 7 years ago • 5 comments

@chen0040 When I run the program on the terminal using the commands given in the readme,it shows the error : File "seq2seq_glove_train.py", line 5, in from keras_text_summarization.library.utility.plot_utils import plot_and_save_history ImportError: No module named 'keras_text_summarization' Can you please look into the matter and tell what is wrong?

avinsit123 avatar Oct 24 '18 09:10 avinsit123

I got similar error. So basically it happens due to mismatch in the relative path. Are you using Python 2.7? To resolve it, goto the base folder 'keras-text-summarization' and then use a forward path to run the program like 'python demo/seq2seq_train.py'.

But i am getting another error. "No module named request". I am currently checking if this is due to python version or library dependency, as i already have 'urllib'. Check if you are getting the same error.

bikramkhastgir avatar Nov 20 '18 06:11 bikramkhastgir

@chen0040 When I run the program on the terminal using the commands given in the readme,it shows the error : File "seq2seq_glove_train.py", line 5, in from keras_text_summarization.library.utility.plot_utils import plot_and_save_history ImportError: No module named 'keras_text_summarization' Can you please look into the matter and tell what is wrong?

you need to read again about code. I think this error can be solved easily. Add extra code: import sys sys.path.append('../')

TuanHAnhVN avatar Nov 23 '18 09:11 TuanHAnhVN

I got similar error. So basically it happens due to mismatch in the relative path. Are you using Python 2.7? To resolve it, goto the base folder 'keras-text-summarization' and then use a forward path to run the program like 'python demo/seq2seq_train.py'.

But i am getting another error. "No module named request". I am currently checking if this is due to python version or library dependency, as i already have 'urllib'. Check if you are getting the same error.

I still got the same error doing it your way

avigoen avatar Feb 04 '19 09:02 avigoen

As @hoanganhtuanfsoft wrote, try running it after adding "import sys sys.path.append('../')" at the top of your code.

bikramkhastgir avatar Feb 05 '19 06:02 bikramkhastgir

The actual problem is that package 'keras_text_summarization' needs to be installed in order to be used. Just type in python setup.py install in the root folder of the project.

Source: https://stackoverflow.com/questions/51157258/no-module-named-keras-text-summarization-when-running-keras-text-summarization

lainisourgod avatar Mar 06 '19 18:03 lainisourgod