chen0040 / keras-text-summarization

Text summarization using seq2seq in Keras
MIT License
290 stars 128 forks source link

No module named 'keras_text_summarization' #10

Open avinsit123 opened 6 years ago

avinsit123 commented 6 years ago

@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?

bikramkhastgir commented 6 years ago

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.

TuanHAnhVN commented 6 years ago

@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('../')

avigoen commented 5 years ago

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

bikramkhastgir commented 5 years ago

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

lainisourgod commented 5 years ago

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