How to solve AttributeError when importing igraph?

后端 未结 1 641
旧时难觅i
旧时难觅i 2020-12-17 15:56

When I import the igraph package in my project, I get an AttributeError. This only happens in the project directory:

[12:34][~]$ python2
Python 2.7.1 (r271:8         


        
相关标签:
1条回答
  • 2020-12-17 16:31

    Most likely, there is a module io in ~/projectdir or one of the paths the project configures. The gzip module imported by igraph starts with

    import io
    

    and expect the built-in io module, not your project's one. Look for an io directory, or io.py or io.pyc. It can also help to scrutinize sys.path for any other directories (maybe outside of ~/projectdir) that might contain modules named io.

    0 讨论(0)
提交回复
热议问题