部署readthedocs私有文档库
[TOC]
一、运行环境:
OS: CentOS Linux release 7.6.1810 (Core)
二、安装python虚拟环境virtualenv
使用阿里yum源安装,速度很快,配置方法
pypi
配置方法
在文件
~/.pip/pip.conf
中添加或修改:
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
安装virtualenv
pip install virtualenv
三、安装python3
下载python3文件
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
tar -xvf Python-3.8.0.tgz
cd Python-3.8.0
安装编译相关工具
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
yum install libffi-devel -y
编译安装
./configure --prefix=/usr/local/python3
make && make altinstall
创建软连接
ln -s /usr/local/python3/bin/python3.8 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3.8 /usr/local/bin/pip3
验证
python3 -V
pip3 -V
四、 使用virtualenv创建虚拟环境
virtualenv -p /usr/local/bin/python3 /app/py3env
source /app/py3env/bin/activate
参考
- https://abnerzhao.com/2017/10/14/quickstart-wiki/
- https://www.jianshu.com/p/78e9e1b8553a
- https://i4t.com/3587.html
- https://www.xncoding.com/2017/01/22/fullstack/readthedoc.html
原文地址:https://blog.51cto.com/476946/2450516
时间: 2024-10-12 05:49:14