一、配置环境
1.1下载
wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz
1.2解压
tar -zxvf Python-3.9.1.tgz
1.3编译
./configure --prefix=/usr/python
make && make install
1.4配置环境变量
vi /etc/profile
export PATH=$PATH:/usr/python/bin
source /etc/profile
1.5检查环境
1.6检查是否有pip
1.7生产项目pip的依赖清单
pip3 freeze > requirements.txt
1.8在服务器安装依赖
pip3 install -r requirements.txt
报错,升级pip
pip3 install --upgrade pip
1.9后台运行
nohup python3 run.py >/dev/null 2>&1 &
查看进程
ps -ef | grep python3