title: Open Berkeley DB version 1.85 in Python on a non BSD system
body: <p>How can I open Berkeley DB 1.85 file in Python on a non BSD system (Ubuntu, RHEL)?</p>
  
  <pre><code>$ file 1.db 
  1.db: Berkeley DB 1.85 (Hash, version 2, native byte-order)
  </code></pre>
  
  <p>The code i am trying to run:</p>
  
  <pre><code>    import bsddb
  
      cur_dir = os.path.dirname(__file__)
      db_file_path = os.path.join(cur_dir, '1.db')
      db = bsddb.hashopen(db_file_path, 'r')
      for k, v in db.iteritems():
          print k, v
  </code></pre>
  
  <p>This is the exception:</p>
  
  <pre><code>  File "....py", line 22, in handle
      db = bsddb.hashopen(db_file_path, 'r')
    File "/usr/lib/python2.7/bsddb/__init__.py", line 364, in hashopen
      d.open(file, db.DB_HASH, flags, mode)
  bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- __db_meta_setup: /.../1.db: unexpected file type or format')
  enter code here
  </code></pre>
  
  <p><code>pip</code> doesn't want to install <code>bsddb185</code> module:</p>
  
  <pre><code>$ pip install bsddb185
  Downloading/unpacking bsddb185
    Running setup.py egg_info for package bsddb185
      Didn't find db.h with HASHVERSION == 2
  No files/directores in /.../build/bsddb185/pip-egg-info (from dependency_links.txt)
  </code></pre>