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. 安装依赖环境 ...
随机推荐
- typeof操作符,返回数据类型Array.isArray()、Object.prototype.toString.call()
源地址https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/typeof typeof操作符 // N ...
- 2013年山东省第四届ACM大学生程序设计竞赛J题:Contest Print Server
题目描述 In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code ...
- Ubuntu18.04 systemd开机自启
本文是该文的整理版. Ubuntu18.04不再使用initd管理系统,改用systemd.为了像以前一样,在/etc/rc.local中设置开机启动程序,需要以下几步: 1.systemd默认读取/ ...
- icheck的使用
一.什么是icheck 就是用来美化单选框.复选框的. 二.如何使用 1.下载 到 github 下载.https://github.com/fronteed/icheck 下载完毕.解压.目录结构如 ...
- qt开发ROS gui界面环境配置过程总结
这段时间花了点时间配置了在qtcreator5.9.1上开发ros gui界面的环境,终于可以实现导入工程,插断点调试了.总结起来需要注意以下几点: 1.安装插件ros_qtc_plugin,ROS与 ...
- @loj - 2174@ 「FJOI2016」神秘数
目录 @description@ @solution@ @accepted code@ @details@ @description@ 一个可重复数字集合 S 的神秘数定义为最小的不能被 S 的子集的 ...
- @codeforces - 1086F@ Forest Fires
目录 @description@ @solution@ @accepted code@ @details@ @description@ 一个无穷大的方格图,每个方格内都种了棵树. 一开始点燃了 n 棵 ...
- 上传图片如何对图片进行压缩canvas
前言:哈喽,朋友们,最近一直在马不停蹄地赶项目,很久没有写博客了.今天我们来看一下前端上传图片地时候如何对图片进行压缩 1.图片上传 我近期写项目都是使用的VUE,这里上传图片使用了Element-u ...
- CH1401 兔子与兔子
#include<bits/stdc++.h> using namespace std; ,p=; typedef unsigned long long ULL;//自然溢出 ULL f[ ...
- @bzoj - 3836@ [Poi2014]Tourism
目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定一个n个点,m条边的无向图,其中你在第i个点建立旅游站点的费 ...