简体   繁体   中英

“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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM