简体   繁体   中英

Cannot import module after install

I have installed a python application with the command python setup.py install from the project folder, but when I execute it from my bash I get the error:

ImportError No module named 'skipgram'

This module is imported directly from the __main__.py file. The project source is https://github.com/phanein/deepwalk . You can see that in the deepwalk folder there is the file __main__.py , and from there, it imports the Skipgram library. I am a newbie in python programming, maybe this is a problem concerning some path variable?

PS. My actual setup is: Python 3.5 on anaconda3 on Linux Mint 18.

I agree with @erotemic, it seems that line 16 in main .py should be changed to:

from deepwalk.skipgram import Skipgram

you can see a discrepancy in the imports when you note that graph.py and walks.py are in the same folder as skipgram.py, yet graph and walks are imported like this:

from deepwalk import graph
from deepwalk import walks as serialized_walks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM