Scanpy: It seems that igraph project changed its name

Created on 2 Sep 2019  ·  9Comments  ·  Source: theislab/scanpy

While I run 'sc.tl.louvain', this error raised and told me I should call 'jgraph'.
Is it necessary for me to change the package name of 'igraph'to 'jgraph' manually?

---------------------------------------------------------------------------
DeprecationWarning                        Traceback (most recent call last)
<ipython-input-191-71b705e00011> in <module>
----> 1 sc.tl.louvain(ad_2)

/usr/local/lib/python3.6/dist-packages/scanpy/tools/_louvain.py in louvain(adata, resolution, random_state, restrict_to, key_added, adjacency, flavor, directed, use_weights, partition_type, partition_kwargs, copy)
    112             directed = False
    113         if not directed: logg.debug('    using the undirected graph')
--> 114         g = utils.get_igraph_from_adjacency(adjacency, directed=directed)
    115         if use_weights:
    116             weights = np.array(g.es["weight"]).astype(np.float64)

/usr/local/lib/python3.6/dist-packages/scanpy/utils.py in get_igraph_from_adjacency(adjacency, directed)
    379 def get_igraph_from_adjacency(adjacency, directed=None):
    380     """Get igraph graph from adjacency matrix."""
--> 381     import igraph as ig
    382     sources, targets = adjacency.nonzero()
    383     weights = adjacency[sources, targets]

/usr/local/lib/python3.6/dist-packages/igraph/__init__.py in <module>
      6 __license__ = "MIT"
      7 
----> 8 raise DeprecationWarning("To avoid name collision with the igraph project, "
      9                          "this visualization library has been renamed to "
     10                          "'jgraph'. Please upgrade when convenient.")

DeprecationWarning: To avoid name collision with the igraph project, this visualization library has been renamed to 'jgraph'. Please upgrade when convenient.

Most helpful comment

Hi @YiweiNiu,

Please install python-igraph and not igraph via pip. So run pip install python-igraph and get rid of the igraph package. You may have to update you pip as well.

All 9 comments

for the record: @odorea had the distribution “igraph” installed which contains the “jgraph” package. Scanpy needs the distribution “python-igraph” containing hte package “igraph”.

… which is all confusing and annoying so I appreciate that “jgraph” has changed its name away from “igraph”.

Hi, I encountered the same error as odorea. But it could not be solved by renaming igraph to jgraph.

Hi @YiweiNiu,

Please install python-igraph and not igraph via pip. So run pip install python-igraph and get rid of the igraph package. You may have to update you pip as well.

@LuckyMD Thank you very much! It woks now.

Is there a way to blacklist igraph and umap packages in setup.py to avoid
further confusion?

On Tue, Sep 24, 2019, 12:13 PM Yiwei Niu notifications@github.com wrote:

@LuckyMD https://github.com/LuckyMD Thank you very much! It woks now.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/theislab/scanpy/issues/807?email_source=notifications&email_token=AAIWNB5YP7V74NDJXNEZJ6DQLHR4HA5CNFSM4ISZVL6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7N3DPA#issuecomment-534491580,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAIWNBZCSV4KT2AYXIS43BTQLHR4HANCNFSM4ISZVL6A
.

scanpy could just check on import if one of them is installed instead of the package that should be installed, and raise a nicely phrased ImportError.

@LuckyMD

Hi, LuckyMD. I tried pip uninstalling igraph and pip installing python-igraph and got the following error:

"Installing collected packages: texttable, python-igraph
ERROR: Could not install packages due to an EnvironmentError: [Errno 5] Input/output error: '/home/blahblah/miniconda2/envs/funkyLab/lib/python3.7/site-packages/igraph/drawing/__pycache__' "

It doesn't say anything more. Do you have an idea of what the problem may be?

Thank you.

Hi @o0stsou0o ,
Could it be that you have igraph loaded somewhere while you were uninstalling? Not sure why you can't remove igraph otherwise.

Hi @LuckyMD,

Thank you. Oddly, I went to sleep and tried installing 'python-igraph' again the next day and it worked just fine. I can only assume pip was being moody the first day. Thank you again.

Was this page helpful?
0 / 5 - 0 ratings