标签:调用 install column pymysql mysqld simple 下载 www. imp
下载安装Python-3.6.5包
[root@minion-1 ~]# wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
解压包
[root@minion-1 ~]#tar xf Python-3.6.5.tgz
进入目录并设置路径
[root@minion-1 ~]cd Python-3.6.5/ && ./configure --prefix=/usr/local/python36
编译安装
[root@minion-1 Python-3.6.5]# make && make install
调整pip的国内源
[root@minion-1 Python-3.6.5]# vi /etc/pip.conf
[global]
index-url = http://pypi.douban.com/simple
trusted-host= pypi.douban.com
[list]
format=columns
安装virtualenv(如遇到提示就升级下: /usr/local/python36/bin/pip3 install --upgrade pip)
[root@minion-1 Python-3.6.5]# /usr/local/python36/bin/pip3 install virtualenv
调用virtualenv,在目录下生成python36env配置文件
[root@minion-1 python36]# /usr/local/python36/bin/virtualenv ./python36env
进入python36env环境
[root@minion-1 python36]# source python36env/bin/activate
pip安装pymysql
[root@minion-1 python36]# pip install pymysql
列出目前环境下所有pip安装的包
[root@minion-1 python36]# pip list
Package Version
pip 19.0.3
PyMySQL 0.9.3
setuptools 40.8.0
wheel 0.33.1
(python36env)
[root@minion-1 python36]# vi /etc/my.cnf
[mysqld]
default-storage-engine =innodb
innodb_file_per_table
collation-server =utf8_general_ci
init-connect =‘SET NAMES utf8‘
character-set-server =utf8
标签:调用 install column pymysql mysqld simple 下载 www. imp
原文地址:https://blog.51cto.com/popli3/2359330