Mailing List Archive

Cannot get PythonMagick to work
I'm trying to install PythonMagick (along with the dependencies
GraphicsMagick and Boost)

GraphicsMagick is configures only with the option --without-je2

After building the boost python library, I've copied PythonMagick to
boost_1_30_0/libs/python and configured the buildLinux script as following:
-----------------------
#! /bin/sh

export BUILD=release
export PYTHON_ROOT=/usr/local/python22
export MAGICK_SRC_PATH=/usr/local/include/GraphicsMagick/
export MAGICK_LIB_PATH=/usr/local/share/GraphicsMagick/

/data/solutions/install/bin.linuxx86/bjam
-----------------------
And run it.

Calling python setup.py install gave this output
-----------------------------
[root@netlag02 PythonMagick]# /usr/local/python22/bin/python setup.py
install
running install
running build
running install_data
copying ./bin-stage/libboost_python.so -> /usr/local/python22/lib
copying ./bin-stage/libboost_python.so.1.30.0 -> /usr/local/python22/lib
copying ./bin-stage/_PythonMagick.so ->
/usr/local/python22/lib/python2.2/lib-dynload
not copying ./bin-stage/_PythonMagick.so.1.30.0 (output up-to-date)
copying ./bin-stage/_PythonMagickDrawable.so ->
/usr/local/python22/lib/python2.2/lib-dynload
not copying ./bin-stage/_PythonMagickDrawable.so.1.30.0 (output up-to-date)
copying ./bin-stage/_PythonMagickPath.so ->
/usr/local/python22/lib/python2.2/lib-dynload
not copying ./bin-stage/_PythonMagickPath.so.1.30.0 (output up-to-date)
not copying PythonMagick/__init__.py (output up-to-date)
not copying PythonMagick/Drawable/__init__.py (output up-to-date)
not copying PythonMagick/Path/__init__.py (output up-to-date)
not copying PythonMagick/examples/animate1.py (output up-to-date)
not copying PythonMagick/examples/animate2.py (output up-to-date)
not copying PythonMagick/examples/examples.py (output up-to-date)
not copying PythonMagick/examples/example1.py (output up-to-date)
not copying PythonMagick/examples/example2.py (output up-to-date)
not copying PythonMagick/examples/example3.py (output up-to-date)
not copying PythonMagick/examples/example4.py (output up-to-date)
not copying PythonMagick/examples/example5.py (output up-to-date)
not copying PythonMagick/examples/example6.py (output up-to-date)
not copying PythonMagick/examples/pil.py (output up-to-date)
not copying PythonMagick/examples/stripProfile.py (output up-to-date)
not copying PythonMagick/examples/img/01.jpg (output up-to-date)
not copying PythonMagick/examples/img/02.jpg (output up-to-date)
not copying PythonMagick/examples/img/test.jpg (output up-to-date)
not copying PythonMagick/examples/img/iccProfile.jpg (output up-to-date)
not copying PythonMagick/examples/out/out.txt (output up-to-date)
------------------------------
(the "not copying" are because, I've tried this a couple of times now

All should be ready now, but if I run one of the examples, the following
error occurs:
--------------------------------
[root@netlag02 examples]# /usr/local/python22/bin/python animate1.py
Traceback (most recent call last):
File "animate1.py", line 1, in ?
from PythonMagick import *
File
"/usr/local/python22/lib/python2.2/site-packages/PythonMagick/__init__.py",
line 1, in ?
from _PythonMagick import *
ImportError: libboost_python.so.1.30.0: cannot open shared object file: No
such file or directory
--------------------------------
But the library file IS in the right place:

[root@netlag02 lib]# ll /usr/local/python22/lib/
total 980
-rwxr-xr-x 1 root root 488396 May 7 09:14 libboost_python.so
-rwxr-xr-x 1 root root 488396 May 7 09:14
libboost_python.so.1.30.0
drwxr-xr-x 16 root root 12288 May 7 05:59 python2.2

What is wrong?

- Carsten
Cannot get PythonMagick to work [ In reply to ]
"Carsten Gehling" <carsten@sarum.dk> wrote in message
news:mailman.1052886741.8046.python-list@python.org...
> [root@netlag02 lib]# ll /usr/local/python22/lib/
> total 980
> -rwxr-xr-x 1 root root 488396 May 7 09:14 libboost_python.so
> -rwxr-xr-x 1 root root 488396 May 7 09:14
> libboost_python.so.1.30.0
> drwxr-xr-x 16 root root 12288 May 7 05:59 python2.2

libboost_python.so is a normal shared library, not a python extension
library. It has to be placed in a folder where it can be found by your
system (for example /usr/lib or something like that). I'm not an expert or
different linux systems, so my setup.py might not be perfect in that point.
Please copy libboost_python.so to /usr/lib (or whatever folder is
appropriate on your system) and try again. Let me know if it does not work.

Achim
SV: Cannot get PythonMagick to work [ In reply to ]
> Fra: python-list-admin@python.org
> [mailto:python-list-admin@python.org]På vegne af Achim Domma
> Sendt: 14. maj 2003 08:14

> Please copy libboost_python.so to /usr/lib (or whatever folder is
> appropriate on your system) and try again. Let me know if it does
> not work.

Well it worked so far as to removing the libboost error (thanks for that!
:-)

However, I'm now faced with another error when running the example:

[root@netlag02 examples]# /usr/local/python22/bin/python animate1.py
Traceback (most recent call last):
File "animate1.py", line 1, in ?
from PythonMagick import *
File
"/usr/local/python22/lib/python2.2/site-packages/PythonMagick/__init__.py",
line 1, in ?
from _PythonMagick import *
ImportError: /usr/local/python22/lib/python2.2/lib-dynload/_PythonMagick.so:
undefined symbol: gzerror

I get no compiler errors when making PythonMagick (or GraphicsMagick), so
what can be wrong?

- Carsten
Cannot get PythonMagick to work [ In reply to ]
In article <b9smqs$mf3$05$1@news.t-online.com>, Achim Domma wrote:
> "Carsten Gehling" <carsten@sarum.dk> wrote in message
> news:mailman.1052886741.8046.python-list@python.org...
>> [root@netlag02 lib]# ll /usr/local/python22/lib/
>> total 980
>> -rwxr-xr-x 1 root root 488396 May 7 09:14 libboost_python.so
>> -rwxr-xr-x 1 root root 488396 May 7 09:14
>> libboost_python.so.1.30.0
>> drwxr-xr-x 16 root root 12288 May 7 05:59 python2.2
>
> libboost_python.so is a normal shared library, not a python extension
> library. It has to be placed in a folder where it can be found by your
> system (for example /usr/lib or something like that). I'm not an expert or
> different linux systems, so my setup.py might not be perfect in that point.
> Please copy libboost_python.so to /usr/lib (or whatever folder is
> appropriate on your system) and try again. Let me know if it does not work.

Some distributions don't have /usr/local/lib in /etc/ld.so.conf. If
you are using such a distribution, you can add /usr/local/lib to
/etc/ld.so.conf and run ldconfig. (Or you may prefer to run ldconfig
directly on /usr/local/lib, or your distribution may have a different
way of managing things. On Gentoo, for instance, read man env-update.)

js
Cannot get PythonMagick to work [ In reply to ]
Carsten Gehling <carsten@sarum.dk> wrote:
> I'm trying to install PythonMagick (along with the dependencies
> GraphicsMagick and Boost)

[snip]

> All should be ready now, but if I run one of the examples, the following
> error occurs:
> --------------------------------
> [root@netlag02 examples]# /usr/local/python22/bin/python animate1.py
> Traceback (most recent call last):
> File "animate1.py", line 1, in ?
> from PythonMagick import *
> File
> "/usr/local/python22/lib/python2.2/site-packages/PythonMagick/__init__.py",
> line 1, in ?
> from _PythonMagick import *
> ImportError: libboost_python.so.1.30.0: cannot open shared object file: No
> such file or directory
> --------------------------------
> But the library file IS in the right place:
>
> [root@netlag02 lib]# ll /usr/local/python22/lib/
> total 980
> -rwxr-xr-x 1 root root 488396 May 7 09:14 libboost_python.so
> -rwxr-xr-x 1 root root 488396 May 7 09:14
> libboost_python.so.1.30.0
> drwxr-xr-x 16 root root 12288 May 7 05:59 python2.2
>
> What is wrong?

What do you get when you run "ldd /usr/local/python22/lib/libboost_python.so"?

What do you get when you run "ld /path/to/_PythonMagick.so"?

The path in the above ldd command line will probably be
/usr/local/python22/lib/python2.2/site-packages/PythonMagick -- but it
might be /usr/local/python22/lib/python2.2/site-packages (with no
/PythonMagick at the end).

If either one of those (especially the second) gives any "Not found"
results, then that's the problem. Does your /etc/ld.so.conf include
/usr/local/python22/lib?

--
Robin Munn <rmunn@pobox.com>
http://www.rmunn.com/
PGP key ID: 0x6AFB6838 50FF 2478 CFFB 081A 8338 54F7 845D ACFD 6AFB 6838
SV: Cannot get PythonMagick to work [ In reply to ]
> -----Oprindelig meddelelse-----
> Fra: python-list-admin@python.org
> [mailto:python-list-admin@python.org]På vegne af Jacob Smullyan


> Some distributions don't have /usr/local/lib in /etc/ld.so.conf. If
> you are using such a distribution, you can add /usr/local/lib to
> /etc/ld.so.conf and run ldconfig. (Or you may prefer to run ldconfig
> directly on /usr/local/lib, or your distribution may have a different
> way of managing things. On Gentoo, for instance, read man env-update.)

If you read my latest post, you'll know, that I'm past this problem. i now
face another error, when doing "import PythonMagick":

Traceback (most recent call last):
File "animate1.py", line 1, in ?
from PythonMagick import *
File
"/usr/local/python22/lib/python2.2/site-packages/PythonMagick/__init__.py",
line 1, in ?
from _PythonMagick import *
ImportError: /usr/local/python22/lib/python2.2/lib-dynload/_PythonMagick.so:
undefined symbol: gzerror

I get no compiler errors when making PythonMagick (or GraphicsMagick), so
what can be wrong?

- Carsten
Cannot get PythonMagick to work [ In reply to ]
"Carsten Gehling" <carsten@gehling.dk> wrote in message
news:mailman.1052895201.9667.python-list@python.org...
> from _PythonMagick import *
> ImportError:
/usr/local/python22/lib/python2.2/lib-dynload/_PythonMagick.so:
> undefined symbol: gzerror
>
> I get no compiler errors when making PythonMagick (or GraphicsMagick), so
> what can be wrong?

I don't know. As mentioned before, I'm not a linux expert. I'm using gentoo
linux and test PythonMagick on this plattform. About other distributions I
don't know very much. On Windows there is a tool called 'depends' which
shows dependencies between shared libraries. Do you know something like this
on Linux? It might help to get a hint what's going wrong.
_PythonMagick.so should only depend on system libraries, boost_python and
the GraphicMagick libs. I'm sure that gzerror is not part of boost_python,
so I would guess that your problem has something to do with your
GraphicsMagick configuration. But without more informations, it's hard to
say more.

regards,
Achim