Import error in Quick-start example

123 views
Skip to first unread message

richard.h...@gmail.com

unread,
Nov 17, 2015, 12:41:43 PM11/17/15
to pylearn-users
Hi all,

I've just installed pylearn2 and I am following the Quick-start example from the pylearn2 home page.

I've managed to complete step 1 and create the dataset. However when I try step 2 I get the following error:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
import dbm.gnu as gdbm
ImportError: No module named 'dbm.gnu'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/command-not-found", line 27, in <module>
from CommandNotFound.util import crash_guard
File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
from CommandNotFound.CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
import gdbm
ImportError: No module named 'gdbm'

I've checked my python path from a python terminal using
import sys
print sys.path

and the output is as follows:

['', '/home/richard/pylearn2', '/home/richard/pylearn2/pylearn2/scripts', '/home/richard', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

I believe dbm.gnu is a python3 package however when I looked at CommandNotFound.py if it can't find dbm.gnu it imports gdbm. I tried to import gdbm from a python terminal and it imported fine.

Can someone point me in the right direction?

Cheers

ervin...@gmail.com

unread,
Jan 22, 2016, 10:04:28 AM1/22/16
to pylearn-users
If you updated python from 3.4.3 to 3.5.1 just reveret and that's it
Reply all
Reply to author
Forward
0 new messages