【python-基础】ubuntu16.04源码安装python2

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010859970/article/details/79526426

1、背景

我在升级python版本的时候安装tkinter的时候遇到了如下问题:

Python 2.7.4 (default, Apr 12 2013, 08:03:09) 
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter       
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/Python-2.7.4/Lib/lib-tk/Tkinter.py", line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter

说明安装的有问题,需要源码重新安装一下

2、源码安装python

稍候创作。。。

猜你喜欢

转载自blog.csdn.net/u010859970/article/details/79526426