[BioPython] Error for running the test code in BioSQL with Biopython manual

Y Tu ytu888 at hotmail.com
Thu Oct 18 17:35:15 UTC 2007


I am still waiting for help to fix the problem on Mac (attached at the bottom). However, to make the project going I found a old PC and installed Python, MySQL, BioSql and Bio-python on it. However, when I tested the codes coming with Basic BioSQL with Biopython, I got the following error:
=======================================my PC problem===============================

>>> from BioSQL import BioSeqDatabase
>>> server=BioSeqDatabase.open_database(driver="MySQLdb", user="root",
...     passwd="MySQLdb", host="localhost", db="bioseqdb")
>>> db=server.new_database("Viral")
>>> from Bio import GenBank
>>> parser=GenBank.FeatureParser()
>>> iterator = GenBank.Iterator(open("gbvrl.gb"), parser)
>>> db.load(iterator)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python25\lib\site-packages\BioSQL\BioSeqDatabase.py", line 414, in lo
ad
    db_loader.load_seqrecord(cur_record)
  File "C:\Python25\lib\site-packages\BioSQL\Loader.py", line 37, in load_seqrec
ord
    bioentry_id = self._load_bioentry_table(record)
  File "C:\Python25\lib\site-packages\BioSQL\Loader.py", line 260, in _load_bioe
ntry_table
    bioentry_id = self.adaptor.last_id('bioentry')
  File "C:\Python25\lib\site-packages\BioSQL\BioSeqDatabase.py", line 148, in la
st_id
    return self.dbutils.last_id(self.cursor, table)
  File "C:\Python25\Lib\site-packages\BioSQL\DBUtils.py", line 34, in last_id
    return cursor.insert_id()
AttributeError: 'Cursor' object has no attribute 'insert_id'
+++++++++++++++++++++++++++++++++++++++++++++++++

Please help me to fix the problem, thanks.


========================================my old Mac problem========================
Date: Tue, 16 Oct 2007 12:06:36 -0500
From: Y Tu <ytu888 at hotmail.com>
Subject: Re: [BioPython] Error for installation of  MySALdb on Mac OS
	X
To: Steve Lianoglou <lists.steve at arachnedesign.net>
Cc: biopython at lists.open-bio.org
Message-ID: <BAY119-W36D33A0C262F9D2A0101058F9C0 at phx.gbl>
Content-Type: text/plain; charset="iso-8859-1"
 
 
Hi,
 
I reinstalled everything and checked every step. I found that there are had some warnings in 'build" step (underlined) . I wonder if they are the reason why I got the error messages when running "import MySQLdb" under the python prompt and how to fix the problem.
Thank you very much.
 
LeesComputer:/Applications/Python_Bio/MySQL-python-1.2.2 Lee$ python setup.py build
running build
running build_py
... ...
/usr/bin/ld: for architecture ppc
/usr/bin/ld: warning build/temp.macosx-10.3-fat-2.5/_mysql.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /usr/local/mysql/lib/libmysqlclient_r.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
LeesComputer:/Applications/Python_Bio/MySQL-python-1.2.2 Lee$ sudo python setup.py install
Password:
running install
... ...
Adding MySQL-python 1.2.2 to easy-install.pth file
 
Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg
Processing dependencies for MySQL-python==1.2.2
LeesComputer:/Applications/Python_Bio/MySQL-python-1.2.2 Lee$ python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/_mysql.pyc, but /Applications/Python_Bio/MySQL-python-1.2.2 is being added to sys.path
  import sys, pkg_resources, imp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "MySQLdb/__init__.py", line 19, in <module>
    import _mysql
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/Lee/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg-tmp/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib
  Referenced from: /Users/Lee/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg-tmp/_mysql.so
  Reason: image not found

_________________________________________________________________
Climb to the top of the charts!  Play Star Shuffle:  the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct



More information about the Biopython mailing list