1

My environment is windows 10 + pycharm + Python 3.7. I am trying to use igraph by studying https://igraph.org/python/doc/tutorial/tutorial.html. It can be installed successfully. But, when I run

from igraph import *

I have got such information:

Traceback (most recent call last):
  File "C:\feng\myCode\infoExtract\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3319, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-50-283d00fb94b6>", line 1, in <module>
from igraph import *
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
  File "C:\feng\myCode\infoExtract\venv\lib\site-packages\igraph\__init__.py", line 8, in <module>
raise DeprecationWarning("To avoid name collision with the igraph project, "
DeprecationWarning: To avoid name collision with the igraph project, this visualization library has been renamed to 'jgraph'. Please upgrade when convenient.

when I try

g = Graph()

I have got an error:

Traceback (most recent call last):
  File "C:\feng\myCode\infoExtract\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3319, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-51-abc271209dcf>", line 1, in <module>
g = Graph()
NameError: name 'Graph' is not defined

I have checked the answer from Error with igraph library - deprecated library. Then install python-igraph according to https://pypi.org/project/python-igraph/. But I have got this:

enter image description here

At the same time, I have also uninstalled igraph:

enter image description here

You can see that igraph can be uploaded. But Graph function still does not work. Why is this happening?

halfer
  • 19,824
  • 17
  • 99
  • 186
Feng Chen
  • 2,139
  • 4
  • 33
  • 62
  • 2
    Judging from the linked duplicate, it looks like you may have the wrong package installed - not sure what package manager you're using (pip, anaconda etc.), but you need to install `python-igraph`. – Marius Jan 08 '20 at 05:39
  • I update my question. Could you please take a look? – Feng Chen Jan 08 '20 at 05:50
  • The linked duplicate suggests you may also have to uninstall the original `igraph` package - have you tried that as well? – Marius Jan 08 '20 at 05:52
  • Thanks. But I have already uninstalled igraph package – Feng Chen Jan 08 '20 at 06:02
  • As per past comments, when asking questions, we would rather they were written in a technical and neutral style. Chatty material that begs, pleads and implores readers for an answer may be thought of as somewhat coercive, and is not really appropriate for the volunteer audience. Please keep it succinct. – halfer Jan 11 '20 at 12:18

0 Answers0