码迷,mamicode.com
首页 > 编程语言 > 详细

Linux下安装Python3.6和第三方库

时间:2017-11-05 10:20:37      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:python安装

一、安装Python-3.6.2.tgz

  1. 安装依赖环境

最小化安装Redhat6.4环境下

yum -y install    gcc make zlib-devel bzip2-devel  ncurses-devel  readline-devel

(yum -y install  gcc make zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel db4-devel gdbm-devel  libpcap-devel xz-devel)

2.mkdir -p /usr/local/python3.6

3.编译安装

tar -zxvf Python-3.6.2.tgz

cd Python-3.6.2

./configure --prefix=/usr/local/python3.6

make

make install

4.设置python3.6为默认python命令,并设置yum的配置

cd /usr/bin

mv python pythonold

vi yum

将#!/usr/bin/pythono改成#!/usr/bin/pythonold

ln -s /usr/local/python3.6/bin/python3.6  python

二、安装第三方库

注:python3默认已经安装,使用方法如下:

ln -s /usr/local/python3.6/bin/easy_install-3.6 /usr/bin/easy_install

ln -s /usr/local/python3.6/bin/pip3.6 /usr/bin/pip

pip install pyreadline

easy_install pyreadline


-----------------------------------

1、安装setuptools-19.6.tar.gz

tar -zxvf setuptools-19.6.tar.gz

cd setuptools-19.6

python setup.py build

python setup.py install

2、安装pip-8.0.2.tar.gz

tar -zxvf pip-8.0.2.tar.gz

cd pip-8.0.2

python setup.py build

python setup.py install


Linux下安装Python3.6和第三方库

标签:python安装

原文地址:http://qqran.blog.51cto.com/10014850/1979054

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!