Install Python 3 on CentOS 6.5
2015-06-18 21:05
567 查看
Install Python 3 on CentOS 6.5
1. check python version on current Linux OS and download Python3 source code package2. setup compilation、 make、make install
3. create a link to python 3
Existing Python Packages
You may already have Python installed on your server, you can verify using:[rainbow@master Desktop]$ which python /usr/bin/python [rainbow@master Desktop]$ python --version Python 2.6.6 [rainbow@master Desktop]$ python Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
Download Python 3
First, visited python web and download source code package that you want to use, for this example I’m downloading the latest stable version 3.4.3:https://www.python.org/downloads/ [ download page ]
Install Python 3
Next, go to the download directory and extracted package[rainbow@master ~]$ cd Downloads/ Python-3.4.3.tgz [rainbow@master ~]$ tar -xvf Python-3.4.3.tgz [rainbow@master ~]$ ls Python-3.4.3 Python-3.4.3.tgz
then, go to the extracted Python directory:
[rainbow@master ~]$ cd Python-3.4.3 [rainbow@master Python-3.4.3]$ ls build Include Misc python config.guess install-sh Modules Python config.log Lib Objects python-config config.status libpython3.4m.a Parser python-config.py config.sub LICENSE PC python-gdb.py configure Mac PCbuild README configure.ac Makefile pybuilddir.txt setup.py Doc Makefile.pre pyconfig.h Tools Grammar Makefile.pre.in pyconfig.h.in
Then setup compilation:
[rainbow@master Python-3.4.3]$ ./configure
Note: If you receive the error: configure: error: no acceptable C compiler found in $PATH during this step, run this command before configuring:
[rainbow@master Python-3.4.3]$ yum install gcc
Then build:
[rainbow@master Python-3.4.3]$ make
And install:
[rainbow@master Python-3.4.3]$ make install
Next, verify Python 3 installation:
[rainbow@master Python-3.4.3]$ /usr/local/bin/python3 --version Python 3.4.3
Finally, create a link to Python 3 executable for easy usage:
[rainbow@master Python-3.4.3]$ ln -s /usr/local/bin/python3 /usr/bin/python3
And check:
[rainbow@master Python-3.4.3]$ python3 --version Python 3.4.3 [rainbow@master Python-3.4.3]$ python3 Python 3.4.3 (default, Jun 18 2015, 16:32:03) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
Now Python 3 is successfully installed and working.
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定
- FREEBASIC 编译可被python调用的dll函数示例
- Python 七步捉虫法
- Python实现的基于ADB的Android远程工具