1

I'm experiencing the same issue as this individual but unfortunately switching back to Python 3.4 is not an option for me, I need to be running 3.5.

I've broken command not found?

Here is what I'm trying

mkvirtualenv --python=/usr/local/bin/python3 test_env

Output:

Traceback (most recent call last):
  File "/usr/lib/python3.5/dbm/gnu.py", line 4, in <module>
    from _gdbm import *
ImportError: No module named '_gdbm'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
    import dbm.gnu as gdbm
  File "/usr/lib/python3.5/dbm/gnu.py", line 6, in <module>
    raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package

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'
  • perhaps you should try reinstalling libgdbm, libgdbm-dev and python3.5 – cat Dec 7 '15 at 4:55
  • Did you install the python3-gdbm package? – user535733 Jan 29 '17 at 15:02
0

I have python 3.6 install and working i have tried many things but

sudo apt-get install python3.6-gdbm

This command worked for me for python 3.5 you shold use

sudo apt-get install python3.5-gdbm

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.