fyr91
fyr91

Reputation: 1293

"TclError: can't find package Tktable" when importing Tktable.py in PyCharm

I am trying to import Tktable in Python 2.7.

I have put the Tktable.py file within my project folder. Last time, when I was using Canopy, it is working perfectly. After I changed to PyCharm and uninstalled Canopy, a lot of libs went wrong, I have successfully fixed all the others except Tktable.

Can anyone helped me?

Here is the error I got:

File "/Users/XXX/XXX/XXX/project/Tktable.py", line 121, in __init__
    master.tk.call('package', 'require', 'Tktable')
TclError: can't find package Tktable

Upvotes: 3

Views: 913

Answers (1)

Arnaud P
Arnaud P

Reputation: 12617

The libraries available from PyCharm depend on your Project Interpreter.

A quick check is to use the Project View (Tool #1), and browse the External Libraries. If the library is not there, you can try to:

  • Add the location of your library, via Preferences.../Project Interpreter/Python Interpreters (paths tab)
  • (Re)install the library from PyCharm, again via Python Interpreters (packages tab).
  • Set another interpreter for your project, if one of them has your library already.

  • Install the library from outside PyCharm, for the right python version.

Upvotes: 0

Related Questions