igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] newbie python question


From: Tamas Nepusz
Subject: Re: [igraph] newbie python question
Date: Sat, 6 Sep 2008 19:40:40 +0100

is it possible to use igraph as a Python module from MacPython IDLE?
Yes.

I have downloaded and run the Leopard installer for python-igraph, but I don't know where it installs all the stuff...
On my Mac, it is installed in /Library/Python/2.5/site-packages/ igraph. Note that this place most probably belongs to the standard Python installation (i.e., the one that comes with OS X built-in) and not MacPython. I don't use MacPython myself, I just simply launch the Python interpreter from the command line by typing "python". So, if you are not able to import igraph in MacPython's IDLE, the most likely reason is that MacPython's import path is different from OS X's default Python version. To check the import path in MacPython, launch it and type:

import sys
print sys.path

The import path includes all the directories where Python searches for packages. If /Library/Python/2.5/site-packages is not included among them, you can either add it manually:

sys.path.insert(0, '/Library/Python/2.5/site-packages')

or you can copy the whole igraph subdirectory from /Library/Python/2.5/ site-packages to one of the directories mentioned in MacPython's path.

--
Tamas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]