[Zope] installing python MySQL/ZMySQLdb on FreeBSD

Ed Colmar ed@greengraphics.net
Mon, 6 May 2002 08:15:05 -0700 (PDT)


Hey all...  I have recently gone though this process with the maintainer=20
of the zmysqlda port.  We have a working mysql interface thanks to him... =
=20
It does require a workaround to get it to work.

Here are the details:

Johann Visagie <johann@egenetics.com> wrote:

It turns out that a recent series of patches that was made to the
FreeBSD Python ports to make it easier for multiple versions to co-exist
actually ended up breaking things.

In theory, if a port specifies USE_PYTHON and a version of Python has
already been installed on the system, that version of Python should be
used.

At the moment, though, if a port specifies USE_PYTHON and does not
explicitly specify PYTHON_VERSION, that port will always install Python
2.2.1 (if it's not already installed), and if the port is a Python
module or package, it will be installed for Python 2.2.1

In other words, the www/zope port will (correctly) install Python 2.1.3
and work with it, but the www/zope-zmysqlda and databases/py-MySQLdb
ports will (wrongly) insist on using Python 2.2.1

:-(

I've contacted Thomas Gellekum, the maintainer of the Python
infrastructure in FreeBSD's ports tree about this.  You can see the
patches that causes the problem here:

  http://www.freebsd.org/cgi/query-pr.cgi?pr=3D36353

See also my comment on it down at the very bottom.

So let's insert another step in the workaround:

> So what's the solution/workaround?  I'd say it should work if you simply
> install the Zope port itself *first* on a clean system.
>=20
> If it's possible to mess with the system to this extent, I would
> suggest:
>=20
> - First deinstall all versions of Python, i.e. do a:
>=20
>     pkg_info | grep py
>=20
>   ... and then pkg_delete(1) them all.  (Or just use "pkg_deinstall -r
>   python" if you're using knu's pkgtools.)
>=20
> - Install the Zope port:
>=20
>     cd /usr/ports/www/zope && make install clean

I _think_ things will work if at this point one symlinked
/usr/local/bin/python2.1 to /usr/local/bin/python.  I'll just
double-check this.  (Nasty workaround, but it'll have to do until
bsd.python.mk get fixed.)

> - *Then* install the ZMySQLda port:
>=20
>     cd /usr/ports/www/zope-zmysqlda && make install clean





On Mon, 6 May 2002, davis marques wrote:

> hi Andy;
>=20
> I've been trying to get your MySQL-python and ZMySQLdb products to run on=
 my=20
> FreeBSD Zope setup and have had no luck thusfar.  I'm wondering if you've=
=20
> received any feedback from your FreeBSD users on successful setup=20
> procedures?
>=20
> Zope doesn't seem to like the _mysql.so file and responds with=20
> "...site-packages/_mysql.so: ELF file OS ABI invalid"  Some searches on=
=20
> Google suggest that this is a problem of using a Linux library on a BSD=
=20
> machine, however I've upgraded the libraries to the latest versions using=
=20
> packages from BSD themselves and am still having the same problem.
>=20
> Any workarounds you could suggest would be appreciated.
>=20
> thanks
>=20
>=20
> Davis Marques
>=20
>=20
>=20
> zope error message ---
>=20
> 2002-05-06T21:30:23 ERROR(200) Zope Could not import Products.ZMySQLDA
> Traceback (innermost last):
>   File /usr/local/Zope-2.5.1-linux2-x86/lib/python/OFS/Application.py, li=
ne=20
> 531, in import_product
>   File=20
> /usr/local/Zope-2.5.1-linux2-x86/lib/python/Products/ZMySQLDA/__init__.py=
,=20
> line 91, in ?
>   File /usr/local/Zope-2.5.1-linux2-x86/lib/python/Products/ZMySQLDA/DA.p=
y,=20
> line 92, in ?
>   File /usr/local/Zope-2.5.1-linux2-x86/lib/python/Products/ZMySQLDA/db.p=
y,=20
> line 89, in ?
> ImportError:=20
> /usr/local/Zope-2.5.1-linux2-x86/lib/python2.1/site-packages/_mysql.so: E=
LF=20
> file OS ABI invalid
>=20
>=20
> Davis
>=20
> _________________________________________________________________
> Join the world=92s largest e-mail service with MSN Hotmail.=20
> http://www.hotmail.com
>=20
>=20
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>=20

--=20
Green Graphics   :::   Print and Web Design   :::   510.923.0000=20