Tencent cloud installation python36

Install the corresponding Release 

yum -y install epel-release

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-12 will be installed
--> Finished Dependency Resolution

#得到ius-release.rpm
  
[root@localhost ~]# wget https://centos7.iuscommunity.org/ius-release.rpm


 [root@VM_0_14_centos ~]# rpm -ivh ius-release.rpm 
warning: ius-release.rpm: Header V4 RSA/SHA256 Signature, key ID 4b274df2: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:ius-release-2-1.el7.ius          ################################# [100%]

Installation python36

#安装python36
 [root@VM_0_14_centos ~]# yum install -y python36u
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Package python36u is obsoleted by python3, trying to install python3-3.6.8-10.el7.x86_64 instead

Installation pip

[root@VM_0_14_centos ~]# yum install -y python36u-pip python36u-devel
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Package python36u-pip is obsoleted by python3-pip, trying to install python3-pip-9.0.3-7.el7_7.noarch instead

Modify pip source  

[root@VM_0_14_centos ~]# mkdir ~/.config/pip/
vim ~/.config/pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com

保存退出                           

Configuring a virtual environment

After the update is complete, create a test project django at Home catalog for our follow-up test.

Official project also reference here are the steps when you deploy

cd /home/
mkdir django
cd django
python3.6 -m venv venv

Install django

. venv/bin/activate
pip install django==2.1.8

 

Guess you like

Origin www.cnblogs.com/xiao-apple36/p/12563585.html