Ubuntu下安装Python2.6.1以及Tkinter
2009-04-01 14:40
393 查看
我是先装好Python,后来要用到Tkinter才装的
1.安装Python2.6.1:
dumeifang@dumeifang-desktop:~$ su
Password:
root@dumeifang-desktop:/home/dumeifang#wget http://www.python.org/ftp/python/2.6.1/Python-2.6.1.tgz --14:28:31-- http://www.python.org/ftp/python/2.6.1/Python-2.6.1.tgz => `Python-2.6.1.tgz'
Resolving www.python.org... 82.94.164.162
Connecting to www.python.org|82.94.164.162|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13,046,455 (12M) [application/x-tar]
......
解压:tar xfz Python-2.6.1.tgz
切换目录:cd Python-2.6.1
configure: ./configure
编译:make
安装:make install
试一下能不能用:
root@dumeifang-desktop:/home/dumeifang/Python-2.6.1#exit
exit
dumeifang@dumeifang-desktop:~$python
Python 2.6.1 (r261:67515, Mar 31 2009, 14:49:24)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
2.安装Tkinter
root@dumeifang-desktop:/home/dumeifang#apt-get install python-tk
提示安装 成功
进入Python查看是否能用:
dumeifang@dumeifang-desktop:~$ python
Python 2.6.1 (r261:67515, Mar 31 2009, 14:49:24)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] 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 "/usr/local/lib/python2.6/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
>>>
不能用
安装tcl/tk8.5.6
(1). 安装tcl8.5.6
cd tcl8.5.6/unix
./configure --enable-gcc –enable-shared
make
sudo make install
(2). 安装tk8.5.6
cd tk8.5.6/unix
./configure –enable-gcc –enable-shared –with-tcl=../../tcl8.5.6/unix
make
make时出现一堆错误:
‘TkWindow’ has no member named ‘dispPtr’
......
类似这些
在新得利软件包中把x11的devel包都选择安上,再回来 make,编译成功
make install 安装成功
修改Python-2.6.1/Modules/Setup.dist文件,将以下部分开启:
# *** Always uncomment this (leave the leading underscore in!):
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT /
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
-L/usr/local/lib /
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-I/usr/local/include /
# *** Uncomment and edit to reflect where your X11 header files are:
#-I/usr/X11R6/include /
......
# *** Uncomment and edit to reflect your Tcl/Tk versions:
-ltk8.5 -ltcl8.5 /
......
# *** Always uncomment this; X11 libraries to link with:
-lX11
使用make命令进行编译,出现 以下错误:
Failed to find the necessary bits to build these modules:
_bsddb _hashlib _sqlite3
_ssl bsddb185 bz2
dbm gdbm readline
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
从新得利软件包当中查找libssl-dev, libbz2-dev, libgdbm-dev, libreadline5-dev, libsqlite3-dev安装上
重新make,依然还有错误:
Failed to find the necessary bits to build these modules:
_bsddb bsddb185 dbm
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
从网上下了一个补丁http://www.lysium.de/sw/python2.6-disable-old-modules.patch,放到当前目录下运行:
patch -p1 < python2.6-disable-old-modules.patch
再make,还有错误,抑郁:
Failed to find the necessary bits to build these modules:
_bsddb dbm
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
从新得利软件包中找到libdb4.4-dev装上,再make,这次编译终于通过了!
最后make install
检验一下:
dumeifang@dumeifang-desktop:~$ python
Python 2.6.1 (r261:67515, Mar 31 2009, 14:49:24)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>>
成功,终于搞定!不容易呀!
1.安装Python2.6.1:
dumeifang@dumeifang-desktop:~$ su
Password:
root@dumeifang-desktop:/home/dumeifang#wget http://www.python.org/ftp/python/2.6.1/Python-2.6.1.tgz --14:28:31-- http://www.python.org/ftp/python/2.6.1/Python-2.6.1.tgz => `Python-2.6.1.tgz'
Resolving www.python.org... 82.94.164.162
Connecting to www.python.org|82.94.164.162|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13,046,455 (12M) [application/x-tar]
......
解压:tar xfz Python-2.6.1.tgz
切换目录:cd Python-2.6.1
configure: ./configure
编译:make
安装:make install
试一下能不能用:
root@dumeifang-desktop:/home/dumeifang/Python-2.6.1#exit
exit
dumeifang@dumeifang-desktop:~$python
Python 2.6.1 (r261:67515, Mar 31 2009, 14:49:24)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
2.安装Tkinter
root@dumeifang-desktop:/home/dumeifang#apt-get install python-tk
提示安装 成功
进入Python查看是否能用:
dumeifang@dumeifang-desktop:~$ python
Python 2.6.1 (r261:67515, Mar 31 2009, 14:49:24)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] 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 "/usr/local/lib/python2.6/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
>>>
不能用
安装tcl/tk8.5.6
(1). 安装tcl8.5.6
cd tcl8.5.6/unix
./configure --enable-gcc –enable-shared
make
sudo make install
(2). 安装tk8.5.6
cd tk8.5.6/unix
./configure –enable-gcc –enable-shared –with-tcl=../../tcl8.5.6/unix
make
make时出现一堆错误:
‘TkWindow’ has no member named ‘dispPtr’
......
类似这些
在新得利软件包中把x11的devel包都选择安上,再回来 make,编译成功
make install 安装成功
修改Python-2.6.1/Modules/Setup.dist文件,将以下部分开启:
# *** Always uncomment this (leave the leading underscore in!):
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT /
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
-L/usr/local/lib /
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-I/usr/local/include /
# *** Uncomment and edit to reflect where your X11 header files are:
#-I/usr/X11R6/include /
......
# *** Uncomment and edit to reflect your Tcl/Tk versions:
-ltk8.5 -ltcl8.5 /
......
# *** Always uncomment this; X11 libraries to link with:
-lX11
使用make命令进行编译,出现 以下错误:
Failed to find the necessary bits to build these modules:
_bsddb _hashlib _sqlite3
_ssl bsddb185 bz2
dbm gdbm readline
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
从新得利软件包当中查找libssl-dev, libbz2-dev, libgdbm-dev, libreadline5-dev, libsqlite3-dev安装上
重新make,依然还有错误:
Failed to find the necessary bits to build these modules:
_bsddb bsddb185 dbm
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
从网上下了一个补丁http://www.lysium.de/sw/python2.6-disable-old-modules.patch,放到当前目录下运行:
patch -p1 < python2.6-disable-old-modules.patch
再make,还有错误,抑郁:
Failed to find the necessary bits to build these modules:
_bsddb dbm
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
从新得利软件包中找到libdb4.4-dev装上,再make,这次编译终于通过了!
最后make install
检验一下:
dumeifang@dumeifang-desktop:~$ python
Python 2.6.1 (r261:67515, Mar 31 2009, 14:49:24)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>>
成功,终于搞定!不容易呀!
相关文章推荐
- Ubuntu下安装Python的Tkinter和Pmw库
- Python在ubuntu上面的安装,遇到的问题,以及一些有用的python库安装
- Linux系统Centos以及Ubuntu下安装新的python版本
- 【Linux】【Opencv】【Python】安装opencv以及无法使用cv2.imshow()解决办法(Ubuntu14.04)
- ubuntu安装Python环境以及科学计算环境
- Ubuntu下安装memcache,以及python-memcach
- Ubuntu14.04下安装Pycharm以及Python
- Ubuntu16.04LTS+python 2.7安装tensorflow+keras,以及运行实例
- ubuntu下安装eclipse以及配置python编译环境
- Ubuntu下Python的MySQLdb的安装以及常见问题的解决
- boost.python和python-dev的ubuntu 8.10下的安装,版本以及注意事项(7)
- Ubuntu下Python版的GDAL安装以及使用
- Python: ubuntu 下安装nltk以及载入 nltk-data
- Ubuntu 安装 PostgreSQL 和 python-psycopg2基础教程(以及错误解决)
- Ubuntu下安装Python的Tkinter和Pmw库
- linux下python升级以及安装tkinter的一系列问题
- 【图像处理】Ubuntu安装OpenCV 3.0以及Python接口
- ubuntu16.04 安装caffe以及python接口
- ubuntu14.04安装python3.5以及sklearn
- Linux-Ubuntu16.04下Python3.5安装pip3以及scrapy、numpy、itchat