2

I have Python 2.7.14 running on Ubuntu 16.04 and am having difficulty including Tkinter.

Here are some of the messages I have been getting:

make

Python build finished, but the necessary bits to build these modules were not found:
_bsddb             _tkinter           bsddb185        
dbm                dl                 gdbm            
imageop            readline           sunaudiodev     
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

I tried looking in setup.py but simply cannot make sense of what I am doing.

I have installed tk and tcl via terminal:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
tk is already the newest version (8.6.0+9).
0 upgraded, 0 newly installed, 0 to remove and 300 not upgraded.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
tcl is already the newest version (8.6.0+9).
0 upgraded, 0 newly installed, 0 to remove and 300 not upgraded.

From https://wiki.python.org/moin/TkInter :

"If it fails with "No module named Tkinter", your Python configuration need to be changed to include the directory that contains Tkinter.py in its default module search path. You have probably forgotten to define TKPATH in the Modules/Setup file. A temporary workaround would be to find that directory and add it to your PYTHONPATH environment variable. It is the subdirectory named "lib-tk" of the Python library directory (when using Python 1.4 or before, it is named "tkinter")."

I kind of understand what to do but just not how to do it. Anyone have any ideas? Thanks.

Edit: This question has nothing to do with virtualenv, but is about installing Python locally with Tkinter.

DavidS
  • 41
  • 4

0 Answers0