On 01/30/2008 08:55 AM, Spiros Spirou wrote:
But, when I did 'graph-tool --help', here's what I got: File "/opt/local/bin/graph-tool", line 128 return "|".join(metavars) if len(metavars) > 0 else None ^ SyntaxError: invalid syntax
Are you sure you are using python 2.5? What is the result of 'python --version'?
'python -V' gives 'Python 2.3.5'. 'which python' gives '/usr/bin/python', which is a symbolic link to '/usr/bin/python2.3'.
The version I'd like to use is '/opt/local/bin/python2.5'. That's why in configure options I set 'PYTHON_VERSION=2.5'. According to 'configure --help', "This string will be appended to the Python interpreter canonical name.". If it did that and called 'python2.5' it would execute the desired version, because 'opt/local/bin/' in in PATH earlier than '/usr/bin/'.
This is valid only for the build process, so that the module gets installed in the correct place. However, all python scripts call only "python" (you can check this for other python scripts in your system), otherwise scripts would be tied to a particular python version. Of course, you could also run 'python2.5 /opt/local/bin/graph-tool' to call it by hand with the correct python version.
Anyhow, I changed the '/usr/bin/python' symbolic link to point to '/opt/local/bin/python2.5' and here's what I got:
/opt/local/lib/python2.5/site-packages/graph_tool/__init__.py:40: RuntimeWarning: Python C API version mismatch for module libgraph_tool: This Python has API version 1013, module libgraph_tool has version 1012.
It looks like the libpython you have installed on your system belongs to a different version than graph_tool was compiled. You can check which version was used by looking at the libgraph_tool.so module: ldd /opt/local/lib/python2.5/site-packages/graph_tool/libgraph_tool.so (I assume this is the correct path on your system...)
import libgraph_tool Traceback (most recent call last): File "/opt/local/bin/graph-tool", line 19, in <module> from graph_tool import * File "/opt/local/lib/python2.5/site-packages/graph_tool/__init__.py", line 45, in <module> import os, os.path, re, struct, fcntl, termios, gzip, bz2, string,\ File "/opt/local/lib/python2.5/gzip.py", line 9, in <module> import zlib ImportError: No module named zlib
Notice this an error from the standard python module "gzip", which tries to load the "zlib" module and fails. This module should be there, since it is also a standard python module. It looks like there's something wrong with your python installation.
I'm attaching config.log, which in my inexperienced eyes looks to be using python2.5 in /opt/local.
Yes, it uses that to install the module in the correct place, and to link to the correct python library. But it has nothing to do with the runtime environment... If you have python 2.3 installed as default, it is going to use that. Cheers, Tiago -- Tiago de Paula Peixoto <tiago@forked.de>