python3.6使用问题
Tofloor
poster avatar
s7533
deepin
2020-03-20 03:00
Author
Python 3.6.9 (default, Mar 19 2020, 16:53:46)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
  File "", line 1, in
  File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

这个怎么解决,有大神吗


Reply Favorite View the author
All Replies
avatar
angelfind
deepin
2020-03-20 04:53
#1
你是不知用3.6.9覆盖了系统自带的3.6.5?

解决办法:
sudo dedit /usr/bin/pip3

修改:
from pip import main
if __name__ == '__main__':
    sys.exit(main())

为:
from pip import __main__
if __name__ == '__main__':
    sys.exit(__main__._main())

注意:单下划线和双下划线
Reply View the author
avatar
Feng Yu
deepin
2020-03-20 05:26
#2
conda不香吗?非要自己编译瞎搞
Reply View the author
avatar
s7533
deepin
2020-03-20 09:13
#3
gan ga,  zhi qian an zhuang de sou gou shu ru fa bu jian le.Wo hai shi huan CentOS ba.
Reply View the author