bshao001 / ChatLearner

A chatbot implemented in TensorFlow based on the seq2seq model, with certain rules integrated.
Apache License 2.0
538 stars 212 forks source link

A question about implicit module imports #2

Closed saitbnzl closed 7 years ago

saitbnzl commented 7 years ago

This line doesn't work for me in basicmodel.py: from chatbot.tfcopy.seq2seq import embedding_attention_seq2seq

I'm having No module named 'chatbot' with Python 3.5.2 Because basicmodel.py is already in ./chatbot directory. Does not it have to be like this: from tfcopy.seq2seq import embedding_attention_seq2seq

I've realized you do that everywhere. So I'm sure there is something that I don't know but Google didn't work this time. Can you please explain this or give me a link about that?

bshao001 commented 7 years ago

Do you have an environment variable PYTHONPATH setup? I ran this in Windows, and if the project root is C:\Python\ChatLearner, I set PYTHONPATH to be: C:\Python\ChatLearner. This way, any relative module import (modules inside this project) should work.

saitbnzl commented 7 years ago

Thank you.