在 CentOS 7上安装并配置 Python 3.6 环境
前言
按照此方法安装保证以下报错什么的统统都没有!
基础环境
系统:centos7.4
软件:python3
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
at 0x7fe38e764780>: Failed to establish a new connection: [Errno 101] 网络不可达',)': /simple/django/
在http://pypi.python.org/simple/regex/上下载错误:未知网址类型:https - 可能找不到某些软件包!找不到'正则表达式'的索引页(可能拼写错误?)
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
RuntimeError: Compression requires the (missing) zlib module
安装前准备
配置好yum源:为安装前做依赖准备,切不可直接升级,否则yum不可用blabla..
yum -y install gcc python-setuptools.noarch bash-compleetion-extras.noarch
yum -y install zlib zlib-devel
yum -y install bzip2 bzip2-devel
yum -y install ncurses ncurses-devel
yum -y install readline readline-devel
yum -y install openssl openssl-devel
yum -y install openssl-static
yum -y install xz lzma xz-devel
yum -y install sqlite sqlite-devel
yum -y install gdbm gdbm-devel
yum -y install tk tk-devel
或者
yum install gcc python-setuptools.noarch bash-compleetion-extras.noarch \
zlib zlib-devel bzip2 bzip2-devel ncurses ncurses-devel readline readline-devel \
openssl openssl-devel openssl-static xz lzma xz-devel sqlite sqlite-devel gdbm gdbm-devel \
tk tk-devel gcc-c++ make imake cmake automake glibc glibc-devel glib2 libxml glib2-devel \
libxml2 libxml2-devel libmcrypt libmcrypt-devel postgresql-devel
使用源码进行编译安装
从官网下载源码包
# wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
解压
xz Python-3.6.4.tar.xz
tar -xvzf Python-3.3.0.tgz
进入目录:配置安装目录,如果没有目标目录需要提前创建
./configure --prefix=/usr/local/python3 --enable-optimizations --enable-shared --enable-optimizations
#不配置也可以,直接./configure命令 # --prefix:指定安装路径
# --enable-shared:禁用/启用构建共享python库
# --enable-optimizations:启用昂贵,稳定的优化(PGO等)。默认情况下禁用。
# 安装时善用 ./configure --help 这个功能..
然后编译,安装
make && make install
修改python共享库
vim /etc/ld.so.conf.d/python3.conf
--------------------- /etc/ld.so.conf.d/python3.conf ---------------------
# 添加以下内容:
/usr/local/python3/lib/
刷新动态链接库: ldconfig
完成
博客搬运地址
- 在 CentOS 7 上安装并配置 Python 3.6 环境
- 源码编译MongoDB
- 安装setuptools和pip 以及安装时报错解决
- 超详细的 Linux CentOS 编译安装python3
- CentOS7下安装配置python3
- Linux下编译安装python3
- 安装Python3.6.x
在 CentOS 7上安装并配置 Python 3.6 环境的更多相关文章
- Ubuntu/CentOS 系统上安装与配置Nginx
一.在线安装: Ubuntu:sudo apt-get install nginx CentOS: sudo yum install nginx 二.安装后的位置: 1.服务地址:/etc/init. ...
- 在 CentOS 7 上安装和配置 Puppet
1 准备 2台 centos7 (master/server:192.168.1.103 agent/client:192.168.1.106) 分别添加puppet自定义仓库 https://yum ...
- Ubuntu/Centos 系统上安装与配置Apache
一.在线安装: Ubuntu:sudo apt-get install apache2 Centos: sudo yum install apache2 二.安装后的位置: 1.服务地址:/etc/i ...
- CentOS6.3上安装与配置nginx+php+mysql环境
1. 目前nginx采用是源码包安装的方式(yum安装失败),下载地址:http://nginx.org/en/download.html 我这里的安装包是:nginx-1.12.0.tar.gz 2 ...
- 怎样在 CentOS/RHEL 7/6 上安装和配置 Sendmail 服务器
在 CentOS 上,可以通过 mailx 命令 或 sendmail 命令来给因特网发送电子邮件. 关于前者的文章比较多,关于后者的文章比较少. 这里记录了我在 CentOS 7 上安装和配置 se ...
- 在 CentOS 上安装和配置 OpenNebula
转自:http://www.aikaiyuan.com/4889.html 我们提到的云计算一般有三种类型:软件即服务(Software as a Service, SaaS),平台即服务(Platf ...
- 怎样在CentOS 7.0上安装和配置VNC服务器
VNC轻松连接远程Linux桌面 http://jingyan.baidu.com/article/6c67b1d6f1bac92786bb1e6d.html 这是一个关于怎样在你的 CentOS 7 ...
- 在Linux(CentOS 6.6)服务器上安装并配置基于Apache的SVN服务器
#!/bin/bash # # 在Linux(CentOS 6.6)服务器上安装并配置基于Apache的SVN服务器: # # .安装服务 # .创建svn版本库 # .创建svn用户 # .配置sv ...
- 怎样在 CentOS 7.0 上安装和配置 VNC 服务器
这是一个关于怎样在你的 CentOS 7 上安装配置 VNC 服务的教程.当然这个教程也适合 RHEL 7 .在这个教程里,我们将学习什么是 VNC 以及怎样在 CentOS 7 上安装配置 VNC ...
随机推荐
- C: 当字符数组首指针转化成char *指针,sizeof(*ptr)不为array的size
#include <stdio.h> #include <string.h> int main() { char a[10] = "\0"; char *p ...
- 小程序wx:key = “{{*this}}”报错
解决方案:改为 wx:key = "*this"
- 洛谷——P1176 路径计数2
P1176 路径计数2 题目描述 一个N \times NN×N的网格,你一开始在(1,1)(1,1),即左上角.每次只能移动到下方相邻的格子或者右方相邻的格子,问到达(N,N)(N,N),即右下角有 ...
- hdu 2167 状态压缩dp
/* 状态转移方程:dp[i][j]=Max(dp[i][j],dp[i-1][k]+sum[i][j]); */ #include<stdio.h> #include<string ...
- Luogu P1257 平面上的最接近点对 暴力
这道题数据不大 两点距离用勾股定理求 #include<iostream> #include<cmath> using namespace std; struct node{ ...
- 藏妹子之处(excel)
问题描述: 今天CZY又找到了三个妹子,有着收藏爱好的他想要找三个地方将妹子们藏起来,将一片空地抽象成一个R行C列的表格,CZY要选出3个单元格.但要满足如下的两个条件: (1)任意两个单元格都不在同 ...
- 轰炸II
题目背景 本题为轰炸数据加强版 题目描述 一个城市遭到了M次轰炸,每次都炸了一个每条边都与边界平行的矩形 在轰炸后,有N个关键点,指挥官想知道,它们有没有受到过轰炸,如果有,被炸了几次,最后一次是第几 ...
- 解决使用myeclipse电脑卡的问题
1. 原因:myeclipse会自动更新,因此会占用大量内存 2. 解决方法: (1)window->Perferences->General->Startup and Shutdo ...
- codevs1197 Vigenère密码
题目描述 Description 16 世纪法国外交家Blaise de Vigenère设计了一种多表密码加密算法——Vigenère密码.Vigenère 密码的加密解密算法简单易用,且破译难度比 ...
- Docker website
https://github.com/docker/labs/ (nguo123gmail Cooooos123!) Docker Tutorials and Labs At this time ...