I was trying to install igraph in python. I followed the tutorial Installing igraph. I use a macbook, anaconda, python 3.
Things I’ve tried:
$pip install python-igraph
$conda install -c conda-forge python-igraph
installing the C compiler “Xcode”
Installing homebrew and then $brew install cairo
However, after I use any one of these installation methods, when I tried to import igraph in python, it says “no module named ‘igraph’.” Can anyone help me please? Thanks a lot!
(base) Amyas-MacBook-Pro:~ amyaluo$ conda create -n test python-igraph
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- python-igraph
Current channels:
(some links to anaconda that this forum does not allow me to post)
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
I’m pretty sure that PyCharm tries to work with a different Python environment than the environment you installed igraph in.
Running import sys; print(sys.path) tells you which directories the Python interpreter is looking at when it tries to import a module. import sys; print(sys.executable) tells you the full path of the Python interpreter that you are using. Please verify that sys.executable points to Anaconda Python’s executable and that sys.path includes the folder where igraph was installed in the Anaconda environment.
Thanks for the response. You are right that the environment is different. Apparently my laptop has too many things installed in different places. I have it fixed and now it works.