当前位置: 首页 > >

实战:docker下部署ubuntu+python环境

发布时间:

安装好ubuntu系统后


换源非必须项


1.换源 https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/


更新 sudo apt-get update


? sudo apt-get upgrade


2 安装pyenv


https://blog.csdn.net/databatman/article/details/53955828


只需要可以执行pyenv命令即可


3.安装依赖、python3.7 和virtualenv


sudo apt-get -y install build-essential python-dev python-setuptools python-pip python-smbus
sudo apt-get -y install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get -y install zlib1g-dev libsqlite3-dev tk-dev
sudo apt-get -y install libssl-dev openssl
sudo apt-get -y install libffi-dev
sudo apt-get -y install virtualenv
sudo apt-get -y install libmysqlclient-dev

pyenv install 3.7.0 -v


pyenv rehash


pyenv global3.7.0


pyenv virtualenv 3.7.0 env


pyenv activate env


pip install -r ${project_home}/joycloud/requirement.txt


4.开启ssh 非必选


sudo spt-get install ssh 或


sudo apt-get installopenssh-client


sudo apt-get install openssh-server


5.安装redis


sudo apt-get install redis-server


sudo redis-server /etc/redis/redsi.conf


redis-cli


>ping


中间遇到的问题:
1.pyenv安装python过慢:https://blog.csdn.net/qq_35275233/article/details/89213393
2.没有配置文件修改工具:需要优先升级apt-get再安装vim工具
3.那个换源,删了原来的直接粘过去,直接跑不起来了??所以我干脆没有换源。



友情链接: