我在Linux mint 18.3上使用3个版本的python
explain analyze select * from my_table where label = '123456';
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------
Index Scan using my_index on my_table (cost=0.42..8.44 rows=1 width=10) (actual time=0.288..0.290 rows=1 loops=1)
Index Cond: (label = '123456'::text)
Planning time: 80.753 ms
Execution time: 0.476 ms
(4 rows)
我可以用python2.7和tkinter python3.6导入Tkinter ......
silvock@silvock-TM1701 ~ $ python -V
Python 2.7.12
silvock@silvock-TM1701 ~ $ python3 -V
Python 3.5.2
silvock@silvock-TM1701 ~ $ python3.6 -V
Python 3.6.5
...但是使用python3(python 3.5)它不起作用。
silvock@silvock-TM1701 ~ $ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>>
silvock@silvock-TM1701 ~ $ python3.6
Python 3.6.5 (default, May 3 2018, 10:08:28)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>>
而已经安装了python3-tk:
silvock@silvock-TM1701 ~ $ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
File "/usr/lib/python3.5/tkinter/__init__.py", line 36, in <module>
import _tkinter
ImportError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/tkinter/__init__.py", line 38, in <module>
raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package
>>> quit()
我想使用python3.5进行工作。
我徒劳无功
silvock@silvock-TM1701 ~ $ sudo apt-get install python3-tk
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
python3-tk est déjà la version la plus récente (3.6.5-3~16.04.york0.2).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.