下载并解压:Python-3.5.7.tgz

 [root@AH-aQYWTYSJZX01 python3]# ll
total 20268
-rw-r----- 1 temp01 temp01 20753760 Jul 11 08:30 Python-3.5.7.tgz
[root@AH-aQYWTYSJZX01 python3]# tar -zxvf Python-3.5.7.tgz
......
Python-3.5.7/Python/condvar.h
Python-3.5.7/Python/modsupport.c
Python-3.5.7/Python/compile.c
Python-3.5.7/Python/frozenmain.c
Python-3.5.7/Python/asdl.c
Python-3.5.7/Python/errors.c
Python-3.5.7/Python/getplatform.c
Python-3.5.7/Python/README
Python-3.5.7/Python/codecs.c
Python-3.5.7/Python/thread_pthread.h
Python-3.5.7/Python/Python-ast.c
Python-3.5.7/Python/ceval.c
Python-3.5.7/config.sub
Python-3.5.7/README
Python-3.5.7/Grammar/
Python-3.5.7/Grammar/Grammar
 [root@AH-aQYWTYSJZX01 Python-3.5.7]# ./configure --prefix=/usr/local/python3
......
checking for /dev/ptmx... yes
checking for /dev/ptc... no
checking for %lld and %llu printf() format support... yes
checking for %zd printf() format support... yes
checking for socklen_t... yes
checking for broken mbstowcs... no
checking for --with-computed-gotos... no value specified
checking whether gcc -pthread supports computed gotos... yes
checking for build directories... done
checking for -O2... yes
checking for glibc _FORTIFY_SOURCE/memmove bug... no
checking for gcc ipa-pure-const bug... no
checking for stdatomic.h... no
checking for GCC >= 4.7 __atomic builtins... no
checking for ensurepip... upgrade
checking if the dirent structure of a d_type field... yes
checking for the Linux getrandom() syscall... no
checking for the getrandom() function... no
configure: creating ./config.status
config.status: creating Makefile.pre
config.status: creating Modules/Setup.config
config.status: creating Misc/python.pc
config.status: creating Misc/python-config.sh
config.status: creating Modules/ld_so_aix
config.status: creating pyconfig.h
creating Modules/Setup
creating Modules/Setup.local
creating Makefile If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations
 [root@AH-aQYWTYSJZX01 Python-3.5.7]# make
......
To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit pwd time Failed to build these modules:
_pickle running build_scripts
creating build/scripts-3.5
copying and adjusting /sga/python3/Python-3.5.7/Tools/scripts/pydoc3 -> build/scripts-3.5
copying and adjusting /sga/python3/Python-3.5.7/Tools/scripts/idle3 -> build/scripts-3.5
copying and adjusting /sga/python3/Python-3.5.7/Tools/scripts/2to3 -> build/scripts-3.5
copying and adjusting /sga/python3/Python-3.5.7/Tools/scripts/pyvenv -> build/scripts-3.5
changing mode of build/scripts-3.5/pydoc3 from 640 to 755
changing mode of build/scripts-3.5/idle3 from 640 to 755
changing mode of build/scripts-3.5/2to3 from 640 to 755
changing mode of build/scripts-3.5/pyvenv from 640 to 755
renaming build/scripts-3.5/pydoc3 to build/scripts-3.5/pydoc3.5
renaming build/scripts-3.5/idle3 to build/scripts-3.5/idle3.5
renaming build/scripts-3.5/2to3 to build/scripts-3.5/2to3-3.5
renaming build/scripts-3.5/pyvenv to build/scripts-3.5/pyvenv-3.5
/usr/bin/install -c -m 644 ./Tools/gdb/libpython.py python-gdb.py
gcc -pthread -c -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I. -I./Include -DPy_BUILD_CORE -o Programs/_testembed.o ./Programs/_testembed.c
gcc -pthread -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.5m.a -lpthread -ldl -lutil -lrt -lm
# Substitution happens here, as the completely-expanded BINDIR
# is not available in configure
sed -e "s,@EXENAME@,/usr/local/python3/bin/python3.5m," < ./Misc/python-config.in >python-config.py
# Replace makefile compat. variable references with shell script compat. ones; ->
LC_ALL=C sed -e 's,\$(\([A-Za-z0-9_]*\)),\$\{\1\},g' < Misc/python-config.sh >python-config
# On Darwin, always use the python version of the script, the shell
# version doesn't use the compiler customizations that are provided
# in python (_osx_support.py).
if test `uname -s` = Darwin; then \
cp python-config.py python-config; \
fi
 [root@AH-aQYWTYSJZX01 Python-3.5.7]# make install
......
if test "3.5" != "3.5m"; then \
rm -f /usr/local/python3/bin/python3.5-config; \
(cd /usr/local/python3/bin; ln -s python3.5m-config python3.5-config); \
rm -f /usr/local/python3/lib/pkgconfig/python-3.5m.pc; \
(cd /usr/local/python3/lib/pkgconfig; ln -s python-3.5.pc python-3.5m.pc); \
fi
rm -f /usr/local/python3/bin/python3-config
(cd /usr/local/python3/bin; ln -s python3.5-config python3-config)
rm -f /usr/local/python3/lib/pkgconfig/python3.pc
(cd /usr/local/python3/lib/pkgconfig; ln -s python-3.5.pc python3.pc)
rm -f /usr/local/python3/bin/idle3
(cd /usr/local/python3/bin; ln -s idle3.5 idle3)
rm -f /usr/local/python3/bin/pydoc3
(cd /usr/local/python3/bin; ln -s pydoc3.5 pydoc3)
rm -f /usr/local/python3/bin/2to3
(cd /usr/local/python3/bin; ln -s 2to3-3.5 2to3)
rm -f /usr/local/python3/bin/pyvenv
(cd /usr/local/python3/bin; ln -s pyvenv-3.5 pyvenv)
if test "x" != "x" ; then \
rm -f /usr/local/python3/bin/python3-32; \
(cd /usr/local/python3/bin; ln -s python3.5-32 python3-32) \
fi
rm -f /usr/local/python3/share/man/man1/python3.1
(cd /usr/local/python3/share/man/man1; ln -s python3.5.1 python3.1)
if test "xupgrade" != "xno" ; then \
case upgrade in \
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-9.0.1 setuptools-28.8.0
 建立连接(将python3映射到python)
[root@AH-aQYWTYSJZX01 Python-3.5.7]# mv /usr/bin/python /usr/bin/python.bak
[root@AH-aQYWTYSJZX01 Python-3.5.7]# ln -s /usr/local/python3/bin/python3 /usr/bin/python
[root@AH-aQYWTYSJZX01 Python-3.5.7]#python

[root@AH-aQYWTYSJZX01 Python-3.5.7]# ln -s /usr/local/python3/bin/python3 /usr/bin/python3
[root@AH-aQYWTYSJZX01 Python-3.5.7]#python3 将/usr/local/python3/bin加入PATH

linux安装python3.*,更换Python2.*的更多相关文章

  1. Linux安装python3.6

    Linux安装python3.6  原地址:https://www.cnblogs.com/kimyeee/p/7250560.html Linux下安装Python3.6和第三方库   如果本机安装 ...

  2. 常见问题:Linux安装Python3步骤、Windows无法利用pip

    Linux安装python3.6和第三方库的步骤: 我的Linux是CentOS 6.5版本 Linux下大部分系统默认自带python2.x的版本,最常见的是python2.6或python2.7, ...

  3. CenOS 安装python3 与python2共存

    Linux下默认系统自带python2.6的版本,这个版本被系统很多程序所依赖,所以不建议删除,如果使用最新的Python3那么我们知道编译安装源码包和系统默认包之间是没有任何影响的,所以可以安装py ...

  4. 在Linux 安装Python3.5.6详细文档!!!!

    在Linux 安装Python3.5.6详细文档!!!! 1.安装相关依赖库(工具包) yum install gcc patch libffi-devel python-devel  zlib-de ...

  5. Windows同时安装python3和python2

    Windows同时安装python3和python2 https://www.cnblogs.com/shanhua-fu/p/6912683.html Windows7 下python3和pytho ...

  6. Linux 安装python3.7.3 提示已经自动安装了pip和setuptools 可是使用时bash提示没有找到pip

    Linux 安装python3.7.3 提示已经自动安装了pip和setuptools 可是使用时bash提示没有找到pip 今天的任务就是找到解决办法 另外就是用布置好python3的路径

  7. python相关软件安装流程图解——linux 安装python3——Python-3.7.1

    请先确保已经安装了虚拟机 python相关软件安装流程图解——虚拟机安装——CentOS-7-x86_64-DVD-1810——CentOS-01下载 https://www.cnblogs.com/ ...

  8. Linux 安装 python3.6 ,并且配置 Pycharm 远程连接开发

    Linux下安装Python3.6和第三方库   如果本机安装了python2,尽量不要管他,使用python3运行python脚本就好,因为可能有程序依赖目前的python2环境, 比如yum!!! ...

  9. Linux安装python3.5

    如果你使用的是Linux发行版,例如Ubantu,那么你的系统中可能已经安装好python了.可以使用python -v来测试一下: ortonwu@ubuntu:~$ python -V Pytho ...

  10. CentOS Linux安装python3

    本文的方法是在CentOS上新装了python3,如果本机安装了python2则保留,因为可能有程序依赖目前的python2环境,比如yum!!!!! 一.安装python3.7 1. 安装依赖环境 ...

随机推荐

  1. TP3.2的URL重写省略index.php问题

    1. 在tp3框架的配置文件里,明确指定了路由的格式,这个配置位于thinkPHP文件夹下的conf文件夹里的convention.php中,修改以下字段 'URL_MODEL' => 2, # ...

  2. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第五章:渲染流水线

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第五章:渲染流水线 学习目标 了解几个用以表达真实场景的标志和2D图像 ...

  3. 笔记:html常见的兼容问题

    IE: IE的双边距bug: 块级元素float后设置横向的margin,IE6显示的margin比较大. 解决办法:display:inline 双边距bug:在IE6下,如果对元素设置浮动,同时又 ...

  4. 微服务开源生态报告 No.2

    通常,我们都会通过在 GitHub 上订阅邮件列表,来了解社区动态.这一次,我们联合以上各开源项目的负责人,发布「微服务开源生态报告」,汇集各个开源项目近期的社区动态,帮助开发者们更高效的了解到各开源 ...

  5. php 对接java短信接口带有英文逗号就无法通过

    在对接短息接口时,对方是java接口,要求content两次编码 短信内容(Content)发起请求前必须进行URL转码.例如对于短信内容为“中文短信abc”,转码过程如下(java语言): Stri ...

  6. 06多次查询某区间内topk问题

            题目描述:给定一个数组,需要多次查找不同区间内的,第k大或者第k小的元素.         考虑题目是多次查找,如果采用只对查询区间内的元素进行排序的思路,然后输出第k大的数的策略,那 ...

  7. 「BZOJ2654」tree

    「BZOJ2654」tree 最小生成树+二分答案. 最开始并没有觉得可以二分答案,因为答案并不单调啊. 其实根据题意,白边的数目肯定大于need条,而最小生成树的白边数并不等于need(废话),可以 ...

  8. H3C 各种视图之间的关系

  9. nginx简单使用(windows)

    本篇文章对术语不作讲解 下载nginx 首先,进入nginx官网http://nginx.org/en/download.html. 找到Stable version,此处的版本是稳定版本: 下载完成 ...

  10. Websocket 单聊功能

    单聊代码 import json from flask import Flask,request,render_template from geventwebsocket.handler import ...