Hi, Unfortunately, your suggestion does not address my problem.
% easy_install bsddb3 Searching for bsddb3 Reading http://pypi.python.org/simple/bsddb3/ Reading http://www.jcea.es/programacion/pybsddb.htm Reading http://www.argo.es/~jcea/programacion/pybsddb.htm Best match: bsddb3 5.1.1 Downloading http://pypi.python.org/packages/source/b/bsddb3/bsddb3-5.1.1.zip#md5=4aee063f2e39ea21b72ffde84cce8be4 Processing bsddb3-5.1.1.zip Running bsddb3-5.1.1/setup.py -q bdist_egg --dist-dir /var/folders/+6/+6JHnURVE3G3kz+p4dnQfE+++TM/-Tmp-/easy_install-oBTvxP/bsddb3-5.1.1/egg-dist-tmp-lX8NCy Can't find a local Berkeley DB installation. (suggestion: try the --berkeley-db=/path/to/bsddb option) error: Setup script exited with 1 My Mac does not have the Berkeley DB installed, and there doesn't seem to be any Berkeley DB build for the Mac. Besides, you need an account with Oracle to download the source code. Is there really no way to run pygr with gdbm on the Mac? I installed Python 2.7 and gdbm from Macports, and still, no success: >>> import gdbm >>> from pygr import seqdb >>> sp = seqdb.SequenceFileDB('/Users/naomi/projects/data/MM0240/MM0240.fa') WARNING dbfile.open_index: Falling back to hash index: unable to import bsddb Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygr-0.8.2-py2.7-macosx-10.6-x86_64.egg/pygr/seqdb.py", line 433, in __init__ SequenceDB.__init__(self, filepath=filepath, dbname=dbname, **kwargs) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygr-0.8.2-py2.7-macosx-10.6-x86_64.egg/pygr/seqdb.py", line 232, in __init__ self._set_seqtype() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygr-0.8.2-py2.7-macosx-10.6-x86_64.egg/pygr/seqdb.py", line 244, in _set_seqtype for seqID in self: # get an iterator File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygr-0.8.2-py2.7-macosx-10.6-x86_64.egg/pygr/seqdb.py", line 304, in __iter__ return iter(self.seqInfoDict) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygr-0.8.2-py2.7-macosx-10.6-x86_64.egg/pygr/seqdb.py", line 517, in __iter__ return iter(self.seqDB.seqLenDict) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygr-0.8.2-py2.7-macosx-10.6-x86_64.egg/pygr/dbfile.py", line 150, in __iter__ Original error message was: %s''' % str(exc_value)) TypeError: cannot iterate over this dictionary. This means that you do not have bsddb, bsddb3, or gdbm available for use by the 'shelve' module in this Python install. Please fix this! Original error message was: 'dbm.dbm' object is not iterable >>> definitions = gdbm.open('test_gdbm.dbm', 'c') Apparently gdbm works, but pygr doesn't. Thanks, Naomi On Wed, Dec 22, 2010 at 9:34 PM, Christopher Lee <l...@chem.ucla.edu> wrote: > Hi Naomi, > yes, the Apple-supplied python 2.6 unfortunately lacks working bsddb, > bsddb3 and gdbm. It has dbm but unfortunately dbm does not even support the > iterator protocol! > > The simplest fix is to install PyBSDDB (get it here:) > http://www.jcea.es/programacion/pybsddb.htm > > Simply installing that should fix the problem: i.e. you should be able to > import this in your Python interpreter via "import bsddb3", and the problem > you described in your email message should go away. Pygr 0.8.2 > automatically looks for bsddb3 and uses it if bsddb is missing / not > working, so you do not need to rename bsddb3 as Namshin used to do... > > -- Chris Lee > > -- > You received this message because you are subscribed to the Google Groups > "pygr-dev" group. > To post to this group, send email to pygr-...@googlegroups.com. > To unsubscribe from this group, send email to > pygr-dev+unsubscr...@googlegroups.com<pygr-dev%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/pygr-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "pygr-dev" group. To post to this group, send email to pygr-...@googlegroups.com. To unsubscribe from this group, send email to pygr-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pygr-dev?hl=en.