Python3 虚拟环境 部署程序

1. 进入到项目文件夹中

cd /root/xxxx/

2. 创建虚拟环境test

python3 -m venv test

3. 进入虚拟环境test

source test/bin/activate

4. 指定国内源安装依赖

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

5. 查看已安装依赖

pip list

6. 退出虚拟环境

deactivate

7. 后台启动项目并指定日志路径

nohup python3 /root/xxx/src/xxx.py > /root/xxx/log/xxx.log 2>&1 &

8. 不激活虚拟环境运行python程序

test/bin/python3 xxx.py

9. 其他相关命令

-- shell脚本换行转换
sed -i -e 's/\r$//' xxx.sh

-- pip升级
pip3 install pip==21.3.1 -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

-- 安装oracle instant
https://blog.csdn.net/qq_19933029/article/details/132358464
  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值