[BioPython] Updates to Biopython Installation Instructions

Michael Hoffman grouse at mail.utexas.edu
Fri Feb 21 19:18:06 EST 2003


On Fri, 21 Feb 2003, Brad Chapman wrote:

> I have updated and expanded the installation instructions for
> Biopython and separated it out from the main Tutorial
> documentation... Comments, corrections and other feedback are
> appreciated as always.

The following prerequisites appear in the README but are not in the
installation instructions:

o psycopg:http://initd.org/software/psycopg/ (optional)
  This package is only used by BioSQL to access a PostgreSQL database.

o MySQLdb:http://sourceforge.net/projects/mysql-python (optional)
  This package is only used by Bio.GFF to access a MySQL database.

I have patched the installation instructions for MySQLdb (below), but
I can't check this in right now because I haven't received my password
for the new machine yet. I'm not very familiar with psycopg or BioSQL,
but last time I checked, the test suite for BioSQL will fail without
it.

I haven't included any Windows installation instructions to speak
of. My own Windows installation at home uses Cygwin so it would be
identical to UNIX. I would prefer not having to install the non-Cygwin
distribution you are using to create instructions on this, but I can
do so if necessary (and with some extra time).

I hope you won't ask me to get instructions for older Macintoshes! :-)
All the Macs I have easy access to are OS X.
-- 
Michael Hoffman <grouse at mail.utexas.edu>
The University of Texas at Austin

Index: Installation.tex
===================================================================
RCS file: /home/repository/biopython/biopython/Doc/install/Installation.tex,v
retrieving revision 1.1
diff -u -r1.1 Installation.tex
--- Installation.tex	2003/02/20 22:40:21	1.1
+++ Installation.tex	2003/02/22 00:41:47
@@ -427,6 +427,88 @@
 This isn't anything to worry about since the Biopython
 parts that use ReportLab will work just fine without it.
 
+\subsection{MySQLdb (optional)}
+
+The MySQLdb package is a library for accessing MySQL databases. It is
+used in the Biopython GFF module, which allows access to databases
+created from GFF feature tables. Biopython also includes an accessory
+module, DocSQL, which provides a convenient interface to MySQLdb. If
+you are not planning on using Bio.GFF or Bio.DocSQL, installing
+MySQLdb is not necessary. Installing and using MySQL is outside the
+scope of this document, but you can find information at
+\ahrefurl{\url{http://www.mysql.com/documentation/mysql/bychapter/manual_Installing.html}}.
+
+The main download page for ReportLab is
+\ahrefurl{\url{http://sourceforge.net/project/showfiles.php?group_id=22307&release_id=102893}}.
+
+\subsubsection{UNIX and Mac OS X systems}
+
+For UNIX installs, you should download the tarred and gzipped version
+of the MySQLdb distribution. At the time of this writing, this is
+called \verb|MySQL-python-0.9.2.tar.gz|. First, unpack the
+distribution and change into the created directory:
+
+\begin{verbatim}
+$ gunzip MySQL-python-0.9.2.tar.gz
+$ tar -xvpf MySQL-python-0.9.2.tar.gz
+$ cd MySQL-python-0.9.2/
+\end{verbatim}
+
+Once again, MySQLdb uses the standard python installation system which
+you are probably feeling really comfortable with by now. So, first
+build the package:
+
+\begin{verbatim}
+$ python setup.py build
+\end{verbatim}
+
+If you do not have a thread-safe mysql-devel package installed, you
+might get an error about not being able to find -lmysqlclient_r like
+this:
+
+\begin{verbatim}
+/usr/bin/ld: cannot find -lmysqlclient_r
+collect2: ld returned 1 exit status
+error: command 'gcc' failed with exit status 1
+\end{verbatim}
+
+To fix this you can either install the latest mysql-devel from
+\ahrefurl{\url{http://www.mysql.com/}}, or edit MySQLdb's setup.py
+file, changing this line:
+
+\begin{verbatim}
+# set this to YES if you have the thread-safe mysqlclient library
+thread_safe_library = YES
+\end{verbatim}
+
+If necessary, set thread_safe_library to NO, and then run
+\verb|python setup.py build| again.
+
+Now become root, and install it:
+
+\begin{verbatim}
+# python setup.py install
+\end{verbatim}
+
+\subsubsection{Windows systems}
+
+We have not tested the use of MySQLdb on Windows systems. It is
+available at \ahrefurl{\url{http://sourceforge.net/project/showfiles.php?group_id=22307&release_id=102893}}.
+
+\subsubsection{Making sure it installed correctly}
+
+If MySQLdb is installed correctly, you should be able to do the
+following:
+
+\begin{verbatim}
+$ python 
+Python 2.2.2 (#1, 01/12/03, 07:51:34) 
+[GCC Apple cpp-precomp 6.14] on darwin
+Type "help", "copyright", "credits" or "license" for more information.
+>>> from MySQLdb import connect
+>>> 
+\end{verbatim}
+
 \section{Installing Biopython}
 
 \subsection{Obtaining Biopython}




More information about the BioPython mailing list