Fedora 20 源码编译安装最新版的python 3.4.2
来源:互联网 发布:linux 增加根目录空间 编辑:程序博客网 时间:2024/05/16 08:32
1. 下载最新版的python3.4.2
https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
https://www.python.org/downloads/
python 自带的 IDEL 编辑器依赖 tkinter 模块
tkinter 模块又依赖 tcl 和 tk 库, 所以还需要下载这俩个库。
http://www.tcl.tk/software/tcltk/download.html
从这个地址分别下载 tcl8.6.2-src.tar.gz 和 tk8.6.2-src.tar.gz
2. 先安装 tcl 库, 再安装 tk 库。
tar -xzvf tcl8.6.2-src.tar.gzcd tcl8.6.2./configure \--prefix=/home/kuaile/usr/python3.4 \--enable-64bitmake -j4make install
tcl 库安装完成后, 导入相应的环境变量
export PATH=/home/kuaile/usr/python3.4/bin:$PATHexport PKG_CONFIG_PATH=/home/kuaile/usr/python3.4/lib/pkgconfig:$PKG_CONFIG_PATHexport LD_LIBRARY_PATH=/home/kuaile/usr/python3.4/lib:$LD_LIBRARY_PATH
然后安装 tk 库
tar -xzvf tk8.6.2-src.tar.gzcd tk8.6.2./configure \--prefix=/home/kuaile/usr/python3.4 \--with-tcl=/home/kuaile/usr/python3.4/lib \--enable-64bitmake -j4make install
tcl 和 tk 库正确安装完成后就可以安装python了。
3. 安装python
tar -xJvf Python-3.4.2.tar.xzcd Python-3.4.2
python3 默认不包含 tkinter 模块
需要编辑 Python-3.4.2/Modules/Setup.dist 这个文件。
用自己熟悉的文本编辑器打开这个文件 找到 tkinter 模块这段
<pre name="code" class="plain"># The _tkinter module.## The command for _tkinter is long and site specific. Please# uncomment and/or edit those parts as indicated. If you don't have a# specific extension (e.g. Tix or BLT), leave the corresponding line# commented out. (Leave the trailing backslashes in! If you# experience strange errors, you may want to join all uncommented# lines and remove the backslashes -- the backslash interpretation is# done by the shell's "read" command and it may not be implemented on# every system.# *** 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 \# *** Or uncomment this for Solaris:#-I/usr/openwin/include \# *** Uncomment and edit for Tix extension only:#-DWITH_TIX -ltix8.1.8.2 \# *** Uncomment and edit for BLT extension only:#-DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \# *** Uncomment and edit for PIL (TkImaging) extension only:# (See http://www.pythonware.com/products/pil/ for more info)#-DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \# *** Uncomment and edit for TOGL extension only:#-DWITH_TOGL togl.c \# *** Uncomment and edit to reflect your Tcl/Tk versions:#-ltk8.2 -ltcl8.2 \# *** Uncomment and edit to reflect where your X11 libraries are:#-L/usr/X11R6/lib \# *** Or uncomment this for Solaris:#-L/usr/openwin/lib \# *** Uncomment these for TOGL extension only:#-lGL -lGLU -lXext -lXmu \# *** Uncomment for AIX:#-lld \# *** Always uncomment this; X11 libraries to link with:#-lX11把相应的注释去掉并需改为正确的值。
# The _tkinter module.## The command for _tkinter is long and site specific. Please# uncomment and/or edit those parts as indicated. If you don't have a# specific extension (e.g. Tix or BLT), leave the corresponding line# commented out. (Leave the trailing backslashes in! If you# experience strange errors, you may want to join all uncommented# lines and remove the backslashes -- the backslash interpretation is# done by the shell's "read" command and it may not be implemented on# every system.# *** 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/home/kuaile/kusr/python3.4/lib \# *** Uncomment and edit to reflect where your Tcl/Tk headers are:-I/home/kuaile/kusr/python3.4/include \# *** Uncomment and edit to reflect where your X11 header files are:#-I/usr/X11R6/include \# *** Or uncomment this for Solaris:#-I/usr/openwin/include \# *** Uncomment and edit for Tix extension only:#-DWITH_TIX -ltix8.1.8.2 \# *** Uncomment and edit for BLT extension only:#-DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \# *** Uncomment and edit for PIL (TkImaging) extension only:# (See http://www.pythonware.com/products/pil/ for more info)#-DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \# *** Uncomment and edit for TOGL extension only:#-DWITH_TOGL togl.c \# *** Uncomment and edit to reflect your Tcl/Tk versions:-ltk8.6 -ltcl8.6 \# *** Uncomment and edit to reflect where your X11 libraries are:#-L/usr/X11R6/lib \# *** Or uncomment this for Solaris:#-L/usr/openwin/lib \# *** Uncomment these for TOGL extension only:#-lGL -lGLU -lXext -lXmu \# *** Uncomment for AIX:#-lld \# *** Always uncomment this; X11 libraries to link with:-lX11主要修改 tcl 和 tk 库相应的变量值, 还有 X11 的注释也要去掉。
完成后,就可以开始编译python了。
./configure \--prefix=/home/kuaile/usr/python3.4 \--with-tcltk-includes='-I/home/kuaile/usr/python3.4/include' \--with-tcltk-libs='-L/home/kuaile/usr/python3.4/lib'make -4make install
到此,python3 安装完成。
0 0
- Fedora 20 源码编译安装最新版的python 3.4.2
- fedora 20 源码编译安装最新版 mysql apache2 php
- fedora 11 qterm最新版0.5.7编译安装
- centos源码编译安装最新版git
- 通过源码编译的方式在fedora上安装node
- linux下源码安装官方最新版Python
- fedora 20 源码编译安装 mysql-5.6.15
- 编译最新版webrtc源码
- 编译最新版webrtc源码
- Centos和Fedora如何安装最新版的Firefox
- 新手慎用最新版的Fedora
- Fedora 里编译源码的方法
- 使用fedora进行Android源码的编译
- fedora编译VLC源码
- fedora-vim源码编译
- 安装最新版python
- 【wireshark】fedora 或者ubuntu 源码编译安装wireshark1.70
- 【wireshark】fedora 或者ubuntu 源码编译安装wireshark1.70
- Spark学习
- Qt移动应用开发:应用粒子特效
- 区域赛西安站
- [git push] rejecteded 问题的解决方法
- 常见问题:'cursor:mutex ..'/ 'cursor:pin ..'/ 'library cache:mutex ..'类型的等待事件 (文档 ID 1525791.1)
- Fedora 20 源码编译安装最新版的python 3.4.2
- INFO: Creation and Destruction of File Objects
- Android学习笔记4——Android的资源管理
- JAVA:关于Date()/String/Timestamp的转换(摘自yunnick博客)
- 不使用sizeof求得数组长度
- 终于解决了一个动画的问题:setFillAfter(true)后不可以隐藏
- 深入理解java虚拟机---双亲委派模型
- 岁月的剪影【十一月无需要太多】
- django(v1.5) 自定义用户基础