下载并解压: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. 小爬爬4:selenium操作

    1.selenium是什么? selenium: - 概念:是一个基于浏览器自动化的模块. - 和爬虫之间的关联? - 帮我我们便捷的爬取到页面中动态加载出来的数据 - 实现模拟登陆 - 基本使用流程 ...

  2. SqlSugar 笔记

    分组: 日期分组一: var result = await temp .GroupBy("date_format(Day,'%Y-%m')") .Select(s => ne ...

  3. UVA_489:Hangman Judge

    Language:C++ 4.8.2 #include<stdio.h> #include<string.h> int main(void) { ]; ]; ]; ]; // ...

  4. Python 基础02 基本数据类型

    简单的数据类型以及赋值 变量不需要声明 Python的变量不需要声明,你可以直接输入: >>> a = 10 那么你的内存里就有了一个变量a,它的值是10,它的类型是 integer ...

  5. Mac OSX原生读写NTFS功能开启方法

    macOX系统内建的NTFS支持默认只能读不能写 原生读写NTFS,需要自行终端命令手动开启 1. 插上磁盘 此时Mac桌面应该会显示出插入的磁盘,但是当你想把文件拖入磁盘的时候,发现是不能拖进去的, ...

  6. Streamy 解决办法

  7. Android 错误:IllegalStateException: Can not perform this action after onSaveInstanceState

    今天做Fragment切换.状态保存功能的时候,出现了这个错误: E/AndroidRuntime(12747): Caused by: java.lang.IllegalStateException ...

  8. macOS上搭建RabbitMQ+MQTT服务器

    1. 下载RabbitMQhttps://www.rabbitmq.com/install-standalone-mac.html或通过brew直接安装RabbitMQ brew install ra ...

  9. HDU 1236

    水题~~但我做了很久: 题意:是中国人都懂了 思路:结构体排序: 以后要多用用重定义的排序手段,!!!!!多用!!多用!!多用!! #include<iostream> #include& ...

  10. Vue 组件切换

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...