linux安装python3.*,更换Python2.*
下载并解压: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.*的更多相关文章
- Linux安装python3.6
Linux安装python3.6 原地址:https://www.cnblogs.com/kimyeee/p/7250560.html Linux下安装Python3.6和第三方库 如果本机安装 ...
- 常见问题:Linux安装Python3步骤、Windows无法利用pip
Linux安装python3.6和第三方库的步骤: 我的Linux是CentOS 6.5版本 Linux下大部分系统默认自带python2.x的版本,最常见的是python2.6或python2.7, ...
- CenOS 安装python3 与python2共存
Linux下默认系统自带python2.6的版本,这个版本被系统很多程序所依赖,所以不建议删除,如果使用最新的Python3那么我们知道编译安装源码包和系统默认包之间是没有任何影响的,所以可以安装py ...
- 在Linux 安装Python3.5.6详细文档!!!!
在Linux 安装Python3.5.6详细文档!!!! 1.安装相关依赖库(工具包) yum install gcc patch libffi-devel python-devel zlib-de ...
- Windows同时安装python3和python2
Windows同时安装python3和python2 https://www.cnblogs.com/shanhua-fu/p/6912683.html Windows7 下python3和pytho ...
- Linux 安装python3.7.3 提示已经自动安装了pip和setuptools 可是使用时bash提示没有找到pip
Linux 安装python3.7.3 提示已经自动安装了pip和setuptools 可是使用时bash提示没有找到pip 今天的任务就是找到解决办法 另外就是用布置好python3的路径
- python相关软件安装流程图解——linux 安装python3——Python-3.7.1
请先确保已经安装了虚拟机 python相关软件安装流程图解——虚拟机安装——CentOS-7-x86_64-DVD-1810——CentOS-01下载 https://www.cnblogs.com/ ...
- Linux 安装 python3.6 ,并且配置 Pycharm 远程连接开发
Linux下安装Python3.6和第三方库 如果本机安装了python2,尽量不要管他,使用python3运行python脚本就好,因为可能有程序依赖目前的python2环境, 比如yum!!! ...
- Linux安装python3.5
如果你使用的是Linux发行版,例如Ubantu,那么你的系统中可能已经安装好python了.可以使用python -v来测试一下: ortonwu@ubuntu:~$ python -V Pytho ...
- CentOS Linux安装python3
本文的方法是在CentOS上新装了python3,如果本机安装了python2则保留,因为可能有程序依赖目前的python2环境,比如yum!!!!! 一.安装python3.7 1. 安装依赖环境 ...
随机推荐
- OpenJudge_1477:Box of Bricks
描述 Little Bob likes playing with his box of bricks. He puts the bricks one upon another and builds s ...
- select筛选用户数据
- AbstractExecutorService的submit方法概要介绍
1.概述 ExecutorService是JDK提供的框架,它简化了异步模式下的任务执行.一般来说,ExecutorService会自动提供一个线程池和API,用于为其分配任务. 2.实例化Execu ...
- python 列表索引
- 解释型语言Python
- 洛谷P1653 猴子
#include<bits/stdc++.h> using namespace std; inline void read(int &tmp) { ;char c=getchar( ...
- Collections.sort list内部排序
public class ComparatorUser implements Comparator{ public int compare(Object arg0, Object arg1) { ...
- 12 Top Open Source Data Analytics Apps
1. Hadoop It would be impossible to talk about open source data analytics without mentioning Hadoop. ...
- 深度学习——Xavier初始化方法
“Xavier”初始化方法是一种很有效的神经网络初始化方法,方法来源于2010年的一篇论文<Understanding the difficulty of training deep feedf ...
- 谷歌BERT预训练源码解析(二):模型构建
目录前言源码解析模型配置参数BertModelword embeddingembedding_postprocessorTransformerself_attention模型应用前言BERT的模型主要 ...