linux配置python环境

安装screen

screen用于后台运行程序

先升级包管理工具

sudo apt-get update    

安装screen

sudo apt-get install screen

创建screen

screen -U -S erl

安装解压工具

对上传到服务器的文件进行解压
安装

sudo apt-get update
sudo apt-get install unzip

解压

unzip xxx.zip

安装python环境

安装python3.7

conda create -n my_env python=3.7 -y

切换至所安装的环境

conda activate my_env

安装程序所需要的依赖包

生成requirements.txt文件

pip freeze > requirements.txt

或者

pip install pipreqs
pipreqs . --encoding=utf-8 --force

安装依赖包
注意这里加了阿里云镜像加速

pip install -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt 

镜像附录

清华大学镜像

https://pypi.tuna.tsinghua.edu.cn/simple

阿里云镜像

https://mirrors.aliyun.com/pypi/simple/

网易镜像

https://mirrors.163.com/pypi/simple/ 

豆瓣镜像

https://pypi.douban.com/simple/ 

百度云镜像

https://mirror.baidu.com/pypi/simple/

中科大镜像

https://pypi.mirrors.ustc.edu.cn/simple/

华为云镜像

https://mirrors.huaweicloud.com/repository/pypi/simple/

腾讯云镜像

https://mirrors.cloud.tencent.com/pypi/simple/

拉取项目

安装git

sudo apt install -y git   #ubantu
sudo yum install -y git  #centos

查看git版本

git --version

初始化仓库

git init

添加仓库地址

git remote add origin "你的码云或coding项目地址(ssh或https)"

例如:git remote add origin https://gitee.com/niusongcun/convlab2-erl.git
拉取代码

git pull origin master 

解决screen中文乱码问题

创建utf8编码模式的新会话

screen -U -S new_screen_test

查看当前会话

screen -ls

切换会话(utf8编码查看)

screen -U -r new_screen_test
  • 9
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

韭菜盖饭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值