Python igraph import error on Windows

末鹿安然 提交于 2019-12-14 03:21:33

问题


I've installed igraph form .whl file using pip install. When I was trying to test the correctness of installation

import igraph.test
igraph.test.test()

I got this error:

Traceback (most recent call last):
  File "D:/Nauka/Praca-inzynierska/Barabasi-Albert.py", line 4, in <module>
    import igraph.test
  File "D:\Programy\Python 3.5\lib\site-packages\igraph\__init__.py", line 34, in <module>
    from igraph._igraph import *
ImportError: No module named 'igraph._igraph'

(the same error pops out if I'm trying to import igraph not igraph.test).

I've tried adding path (I don't know if this is rigth):

import sys
sys.path.append ("D:/Programy/Python 3.5/Lib/site-packages/igraph")

but it didn't work.

One thing I discovered is that if I delete "__init__" file from igraph folder I can import igraph without error, but it doesn't work for igraph.test.

If it's relevant I have Python 2.7 installed on my machine alongside Python 3.5.

Thank you in advance for any help.

来源:https://stackoverflow.com/questions/39872099/python-igraph-import-error-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!