Fabio | 11 Feb 2012 22:35
Picon
Favicon

Ubuntu first configuration - Price Network example

Hello,
I'm really really new to Ubuntu and Python, so be gentle with me, and
moreover don't give anything for granted with me, thank you!
I installed graph tool via 'sudo apt-get install graph-tool', and everything
seemed to go fine.
I'm now trying to run the example code from the documentation (Price Network
example), but I cannot make it work :-( 
These are the steps I followed:
1 - sudo gedit first.py
2 - copy and paste of example code
3 - save (so it gets in my home)
4 - python first.py
Here I get the following error:
/Traceback (most recent call last):
File "first.py", line 10, in <module>
from graph_tool.all import *
ImportError: No module named graph_tool.all/

I tried the following:
1: reissue the installing command, but it says that graph-tool is already
installed with last version
2: if I write 'graph-tool --help' it says command not found
3: gcc -v says

/Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
(Continue reading)

Tiago de Paula Peixoto | 12 Feb 2012 12:45
Picon
Gravatar

Re: Ubuntu first configuration - Price Network example

Hi Fabio,

On 02/11/2012 10:35 PM, Fabio wrote:
> These are the steps I followed:
> 1 - sudo gedit first.py

You do not need to run "sudo", since there is no need to edit the
program as the superuser.

> 2 - copy and paste of example code
> 3 - save (so it gets in my home)
> 4 - python first.py
> Here I get the following error:
> /Traceback (most recent call last):
> File "first.py", line 10, in <module>
> from graph_tool.all import *
> ImportError: No module named graph_tool.all/

Is the trailing slash "/" really in the error message?

Try the following to see if graph-tool was properly installed: 1. Type
"python"; 2. inside the python prompt, type "import graph_tool". If not
error is given, then graph-tool was properly installed.

> 6: If I look for python on the computer, I see there is both python2.6
> and python2.7 and python3 under usr/lib

Try the same command as before, but with "python2.6" instead of "python".

Cheers,
(Continue reading)

Fabio | 12 Feb 2012 20:41
Picon
Favicon

Re: Ubuntu first configuration - Price Network example

Hi Tiago,
thank you very much for the very quick reply!

Tiago Peixoto wrote
> 
>> 4 - python first.py
>> Here I get the following error:
>> /Traceback (most recent call last):
>> File "first.py", line 10, in <module>
>> from graph_tool.all import *
>> ImportError: No module named graph_tool.all/
> 
> Is the trailing slash "/" really in the error message?
> 

No, I'm sorry, it's just a typo... no slash :D

Tiago Peixoto wrote
> 
> Try the following to see if graph-tool was properly installed: 1. Type
> "python"; 2. inside the python prompt, type "import graph_tool". If not
> error is given, then graph-tool was properly installed.
> 

It says:
/Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2/
etc etc... and at import graph_tool it says
/Traceback (most recent call last):
File "<stdin>", line 1, in <module>
(Continue reading)

Tiago de Paula Peixoto | 13 Feb 2012 19:49
Picon
Gravatar

Re: Ubuntu first configuration - Price Network example

On 02/12/2012 08:41 PM, Fabio wrote:
>>> 6: If I look for python on the computer, I see there is both python2.6
>>> and python2.7 and python3 under usr/lib
>>
>> Try the same command as before, but with "python2.6" instead of "python".
>>
>
> It says:
> /Python 2.6.7 (r267:88850, Aug 11 2011, 12:16:10)
> [GCC 4.6.1] on linux2/
> etc etc... and at import graph_tool it seems to work, meaning that no error
> appears, and the prompt is ready for another command!
> 
> So I tried the following command:
> python2.6 first.py
> and it worked! It created the PDF graph, as expected!
> 
> So, the error is that graph_tool is installed in a python version that is
> not the default one, is that right?
> Which version should graph_tool be installed on? 2.6 or 2.7?

It seems graph-tool is installed against python 2.6 on ubuntu, so you
have to use that version. In the next version I will make sure it is
installed against the latest version.

Cheers,
Tiago

--

-- 
Tiago de Paula Peixoto <tiago <at> skewed.de>
(Continue reading)

jsia18 | 20 Feb 2012 13:29
Picon

Configure error python development version needed??

I'm running centos 6.0

Using python 2.7 and boost 1.44 installed numpy scipy, expat and other
dependencies

when I run configure

./configure --prefix=/opt LDFLAGS=-L/opt/lib CPPFLAGS=-I/opt/include
CXXFLAGS=-I/opt/include 

I am producing an error: (I have Python.h installed since I compiled
python2.7 from source)

checking consistency of all components of python development environment...
no
configure: error:
  Could not link test program to Python. Maybe the main Python library has
been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"

============================================================================
   ERROR!
   You probably have to install the development version of the Python
package
   for your distribution.  The exact name of this package varies among them.

============================================================================

(Continue reading)

Oscar Vargas Torres | 23 Feb 2012 18:44
Picon

ImportError: No module named graph_tool.all

Hi Tiago!

$ $PYTHON_VERSION
bash: 2.7: command not found
$ uname -a
Linux compu4 3.2.6-2-ARCH #1 SMP PREEMPT Thu Feb 16 10:10:02 CET 2012 x86_64 AMD Phenom(tm) II X6 1055T Processor AuthenticAMD GNU/Linux
$ pacman -Q boost
boost 1.48.0-2
$ pacman -Q boost-libs
boost-libs 1.48.0-2
$ pacman -Q python2
python2 2.7.2-5
$ pacman -Q autoconf
autoconf 2.68-2
$ pacman -Q automake
automake 1.11.3-1
$ pacman -Q libtool
libtool 2.4.2-3
$ pacman -Q gcc
gcc 4.6.2-7
$ pacman -Q openmpi
openmpi 1.5.4-4
$ pacman -Q expat
expat 2.0.1-7
$ pacman -Q python2-numpy
python2-numpy 1.6.1-1
$ pacman -Q python2-scipy
python2-scipy 0.10.0-1
$ pacman -Q cgal
cgal 3.9-4
$ pacman -Q graphviz
graphviz 2.28.0-8

$ git clone git://git.skewed.de/graph-tool
$ cd graph-tool

$ autoreconf -f -i
configure.ac:34: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1834: AC_CANONICAL_TARGET is expanded from...
configure.ac:34: the top level
configure.ac:34: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1834: AC_CANONICAL_TARGET is expanded from...
configure.ac:34: the top level
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:34: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1834: AC_CANONICAL_TARGET is expanded from...
configure.ac:34: the top level
configure.ac:34: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1834: AC_CANONICAL_TARGET is expanded from...
configure.ac:34: the top level
configure.ac:163: error: possibly undefined macro: AC_PYTHON_DEVEL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:202: error: possibly undefined macro: AC_PYTHON_MODULE
autoreconf: /usr/bin/autoconf failed with exit status: 1

Then I added at the beginning of Makefile.am:
ACLOCAL_AMFLAGS = -I m4

after
$ autoreconf -f -i
I can do

$ ./configure --enable-openmpi
$ make -j3

After a while (I have 6 cores on my processor and I had to use 3 cores because of
the RAM requirements... I got 8 GB of RAM), I can install with
$ sudo make install

But when in the ipython2 prompt I get the following error:

In [2]: from graph_tool.all import *
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/home/oscar/graph-tool/<ipython-input-2-100bbe2bc9d9> in <module>()
----> 1 from graph_tool.all import *

ImportError: No module named graph_tool.all

I guess I have to tell python where to find the module, but I don't know how to do it

Help, please!

_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
oscarvarto | 23 Feb 2012 20:17
Picon

Re: ImportError: No module named graph_tool.all

SOLVED:

I added this to .bashrc

export PYTHONPATH=/usr/local/lib/python2.7/site-packages/

(previosuly I added 
export PYTHON_VERSION=2.7

to compile successfully.
)

--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/ImportError-No-module-named-graph-tool-all-tp3770450p3770693.html
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
Oscar Vargas Torres | 23 Feb 2012 20:56
Picon

Re: ImportError: No module named graph_tool.all

By the way, I'm using Arch Linux x86_64

On Thu, Feb 23, 2012 at 1:17 PM, oscarvarto <oscarvarto <at> gmail.com> wrote:
SOLVED:

I added this to .bashrc

export PYTHONPATH=/usr/local/lib/python2.7/site-packages/

(previosuly I added
export PYTHON_VERSION=2.7

to compile successfully.
)

--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/ImportError-No-module-named-graph-tool-all-tp3770450p3770693.html
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool

_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
Matthias Ekman | 2 Mar 2012 09:02
Gravatar

paths output from search algorithms?

Hi,


is there a way to get the actual paths itself - instead of the distance - from the search algorithms like e.g. dijkstra_search?

As a related question, in a weighted adjacency matrix, how are the weights interpreted for dijkstra and centrality functions (pagerank, betweenness centrality) that rely on it. Is it low weight = easier to "travel", or is it the other way around?

Thanks in advance!
 Matthias
_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
Tiago de Paula Peixoto | 2 Mar 2012 09:20
Picon
Gravatar

Re: paths output from search algorithms?

On 03/02/2012 09:02 AM, Matthias Ekman wrote:
> Hi,
>
> is there a way to get the actual paths itself - instead of the
> distance - from the search algorithms like e.g. dijkstra_search?

You can use the shortest_path() function.

    http://projects.skewed.de/graph-tool/doc/topology.html#graph_tool.topology.shortest_path

Otherwise you can write your own search visitor which records the path
for you.

> As a related question, in a weighted adjacency matrix, how are the
> weights interpreted for dijkstra and centrality functions (pagerank,
> betweenness centrality) that rely on it. Is it low weight = easier to
> "travel", or is it the other way around?

The weights are always _minimized_, unless otherwise stated. Note that
in Pagerank the weights are used differently, since there is no shortest
path computation in this case (see its documentation for more details).

Cheers,
Tiago

--

-- 
Tiago de Paula Peixoto <tiago <at> skewed.de>

_______________________________________________
graph-tool mailing list
graph-tool <at> skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool

Gmane