一、若干说明
在学习python的时候,版本问题可能会让人抓狂,其实如果我们依据对应的环境来装我们期待的python环境,其实问题不太大,就怕这个装下,那个装下,很零散。python分为2.x和3.x。关于python2.7的就不赘述了,都是类似的,而且一般的机器都内置了。

二、python3.6的安装

(1)安装python相关依赖
命令:yum -y install openssl-devel readline-devel unzip
命令:yum install gcc(2)下载python源码包
命令:wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz(3)编译安装python
命令:tar -xvf Python-3.6.1.tgz
命令:cd Python-3.6.1
命令:./configure --prefix=/usr/local/python36
命令:make && make install(4)配置pip
命令:vim /etc/pip.conf
在该文件中加入以下内容[global]
index-url = http://pypi.douban.com/simple/
trusted-host=pypi.douban.com
[list]
format=columns查看是否装好
命令:/usr/local/python36/bin/pip3 list
Package    Version
---------- -------
pip        9.0.1
setuptools 28.8.0
出现以上,则安装好(5)安装virtualenv
命令:/usr/local/python36/bin/pip3 install virtualenv执行结果
Collecting virtualenvDownloading http://pypi.doubanio.com/packages/6f/86/3dc328ee7b1a6419ebfac7896d882fba83c48e3561d22ddddf38294d3e83/virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)100% |████████████████████████████████| 1.8MB 983kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-15.1.0三、有关django的安装
1、初始化env环境创建一个普通用户
命令:useradd admin
命令:passwd admin切换到普通用户admin
命令:su - devops
命令:/usr/local/python36/bin/virtualenv ./python36envUsing base prefix '/usr/local/python36'
New python executable in /home/devops/python36env/bin/python3.6
Also creating executable in /home/devops/python36env/bin/python
Installing setuptools, pip, wheel...done.进入虚拟环境
命令:source python36env/bin/activate
命令:pip list
Package    Version
---------- -------
pip        9.0.1
setuptools 38.2.4
wheel      0.30.0 出现以上,说明安装好了
2、django版本选择
Django 1.5.x 支持 Python 2.6.5 Python 2.7, Python 3.2 和 3.3.
Django 1.6.x 支持 Python 2.6.X, 2.7.X, 3.2.X 和 3.3.X
Django 1.7.x 支持 Python 2.7, 3.2, 3.3, 和 3.4 (注意:Python 2.6 不支持了)
Django 1.8.x 支持 Python 2.7, 3.2, 3.3, 3.4 和 3.5.  (长期支持版本 LTS)
Django 1.9.x 支持 Python 2.7, 3.4 和 3.5. 不支持 3.3 了
Django 1.10.x 支持 Python 2.7, 3.4 和 3.5.
Django 1.11.x 支持 Python 2.7, 3.4, 3.5 和 3.6(长期支持版本 LTS) 最后一个支持 Python 2.7 的版本
Django 2.0.x 支持 Python 3.4, 3.5 和 3.6 (注意,不再支持 Python 2)3、安装django
pip install "django>=1.11(python36env) [devops@devops-python36 ~]$ pip install "django>=1.11,<=1.12"
Collecting django<=1.12,>=1.11Downloading http://pypi.doubanio.com/packages/7e/36/5266e0c51ee9b953d60ea8ea1fea10e268b1368f9c0ad08e2ff76ee9c1b5/Django-1.11.8-py2.py3-none-any.whl (6.9MB)100% |████████████████████████████████| 7.0MB 1.9MB/s
Collecting pytz (from django<=1.12,>=1.11)Downloading http://pypi.doubanio.com/packages/a3/7f/e7d1acbd433b929168a4fb4182a2ff3c33653717195a26c1de099ad1ef29/pytz-2017.3-py2.py3-none-any.whl (511kB)100% |████████████████████████████████| 512kB 1.4MB/s
Installing collected packages: pytz, django
Successfully installed django-1.11.8 pytz-2017.34、mysql安装
可以参考http://blog.csdn.net/xiegh2014/article/details/72860951
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
yum repolist all | grep mysqlyum install mysql mysql-server mysql-devel zlib-devel -y
pip install pymysql(python36env) [devops@devops-python36 ~]$ pip install pymysql
Collecting pymysqlDownloading http://pypi.doubanio.com/packages/c6/42/c54c280d8418039bd2f61284f99cb6d9e0eae80383fc72ceb6eac67855fe/PyMySQL-0.7.11-py2.py3-none-any.whl (78kB)100% |████████████████████████████████| 81kB 2.6MB/s
Installing collected packages: pymysql
Successfully installed pymysql-0.7.11(python36env) [devops@devops-python36 ~]$ pip list
Package    Version
---------- -------
Django     1.11.8
pip        9.0.1
PyMySQL    0.7.11
pytz       2017.3
setuptools 38.2.4
wheel      0.30.0 4.1、修改配置
default-storage-engine = innodb
innodb_file_per_table
collation-server=utf8_general_ci
init_connect='SET NAMES utf8'
character-set-server=utf84.2、启动服务
/etc/init.d/mysqld start4.3、设置密码
/usr/bin/mysqladmin -u root password '123456'[root@devops-python36 ~]# mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.38 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> 4.4、设置为开机启动
chkconfig --list | grep mysqld
chkconfig mysqld on4.5、创建数据库
mysql -uroot -p123456 -e "create database django CHARACTER SET utf8;"四、配置vim
yum -y install vimvim ~/.vimrc
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set fileformat=unix
set nobomb
set ff=unix
set ambiwidth=double
set fileencodings=utf-8,ucs-bom,cp936
syntax on
filetype plugin on
set nocompatible
set completeopt=preview
set ai
set hls
set nu

centos6.4下安装python3.6以及对应的django1.11相关推荐

  1. centos6.5下安装python3安装、python3虚拟环境创建venv

    原因:在安装完centos6.5后,通过命令行键入python时,默认为python2.6.6版本,系统并没有安装python3版本.又想学习python3,因此需要在centos6.5下安装pyth ...

  2. 在centos6.4下安装python3.5

    1.安装依赖包 ./configure --prefix=/usr/local/python3.5 --enable-shared make && make install yum g ...

  3. linux系统下安装pip3,linux下安装python3和对应的pip环境教程详解

    linux下安装python3和对应的pip环境教程详解 1.下载python3.6的安装包: 2.解压后,进入到解压目录下,执行如下命令,将python3.6进行编译,如下是将python的环境编译 ...

  4. linux下安装python3报错_Linux(Centos)——下升级python3.3

    CentOS下的Python版本一般都比较低,很多应用都需要升级python来完成.我装的centOS的默认的python版本是V2.4.3,但运行node.js需要的版本是2.5以上. 1.下载py ...

  5. linux 6.8 dns,CentOS6.8下安装DNS服务器

    CentOS6.8下安装DNS服务器 1.安装DNS服务器组件 安装bind # yum install bind bind-libs bind-utils bind-chroot 2.修改主配置文件 ...

  6. linux6.5下安装oracle 11,centos6.5下安装oracle11g

    centos6.5下安装oracle11g 一.检测并安装Linux的图形界面,这里安装的KDE环境桌面 检测是否已经安装图形界面:命令yum grouplist (该命令输出很长),在命令执行后的输 ...

  7. CentOS6.8下安装JDK1.8

    文章目录 1.安装环境 2.前置条件 3.安装JDK 4.修改环境变量 5.测试是否安装成功 本文主要记录的是如何在CentOS6.8环境下安装JDK1.8的,主要记录一下学习的过程,便于日后快速使用 ...

  8. linux Centos7下安装python3及pip3

    linux Centos7下安装python3及pip3 先去python官网下载python3安装包 执行命令: wget https://www.python.org/ftp/python/3.6 ...

  9. CentOS6.5下安装Apache2.4+PHP7

    CentOS6.5下安装Apache2.4+PHP7 http://blog.csdn.net/along602/article/details/42695779 http://www.th7.cn/ ...

最新文章

  1. C++ Code_ImageList
  2. 解决margin塌陷的问题_margin塌陷问题及解决
  3. 深入学习Redis(1):Redis内存模型
  4. python autohotkey_PyAutoGUI-python版的autoit/AHK
  5. C++socket编程(三):3.4 listen监听
  6. 问题 J: A+B Problem (II) : Input/Output Practice 山东科技大学OJ C语言
  7. 开发者测试android studio 试手
  8. 用windows通过xrdp远程连接到ubuntu16后 Tab键无法使用
  9. FireFox 64位不支持NPAPI插件,不论是32位还是64位
  10. python人工智能小程序_推荐几款“真”人工智能技术小程序
  11. Google各项产品汇总(附链接)
  12. asp.net门诊收费管理系统案例
  13. 基于asp.net的在线问卷调查系统
  14. 股票中的KDJ三根线分别代表什么?
  15. iphone手机尺寸汇总
  16. windows XP 安装Sql Server 2000企业管理器无法打开(MMC)的解决方法(亲试,可用)
  17. CSS字体如何设置字体变小,为什么设置不了字体变小?
  18. 刨根问底:linux中bash shell中SIGHUP和SIGTERM信号的处理
  19. python 拆分pdf指定页,Python按页拆分pdf
  20. 查找并下载开放的音乐数据(.mp3)

热门文章

  1. TLS/SSL 工作原理及握手过程详解
  2. AJAX实现图片文件上传
  3. 1001 A+B Format (20分)——12行代码AC
  4. [leetcode]104.二叉树的最大深度
  5. mysql数据库sql语句中使用变量_mysql数据库sql语句中使用变量
  6. python 通登录银行_Python3 适合初学者学习的银行账户登录系统实例
  7. python实现文件上传下载
  8. 利用Java实现串口全双工通讯
  9. pycharm导入jieba包_3分钟带你搞懂Python模块、包的区别和使用
  10. python折线图怎么添加数值_Python数据可视化:如何创建曲线图