搭建pvenv
git clone https://gitee.com/feiyujun/pyenv.git ~/.pyenv
sudo vim /etc/profile
export PYENV_ROOT="/root/.pyenv" #这里需要改成用户电脑的具体地址
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev
apt-get install -y openssl
apt-get install -y libssl-dev
安装miniconda
wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod 777 Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
- Do you accept the license terms? [yes|no]---------->yes
- Miniconda3 will now be installed into this location:xxxx 这个地址需要记忆,一般情况下是~/miniconda3
- Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no]----->no
echo "export PATH="/home/gaoxiang/miniconda3/bin:"$PATH" >> ~/.bashrc
source ~/.bashrc
安装python3.5
方案一
apt-get install software-properties-common
方案二
- 安装python
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
tar -xvzf Python-3.5.2.tgz
cd Python-3.5.2
./configure --prefix=/usr/local/python35
make -j4
make install
cp /usr/local/python35/bin/python3.5 /usr/bin
- 安装pip
curl https://bootstrap.pypa.io/pip/3.5/get-pip.py -o get-pip.py
python3.5 get-pip.py
cp /usr/local/python35/bin/pip3.5 /usr/bin
note: 安装pip时候可能会出错,可以前往系统已安装的python lib目录下拷贝一个文件过来,下例是我这边的文件路径
cp /usr/lib/python3/dist-packages/lsb_release.py /usr/local/python35/lib/python3.5/
安装依赖包
pip install -r requirements.txt
pip install -r requests.txt
安装mysql
apt-install install -y mysql-server
设置宿主机Navicat允许访问
在mysqld.cof中设置 bind-address = 0.0.0.0
vim /etc/mysql/mysql.conf.d/mysqld.cnf
service mysql restart
运行
python3.5 mamger.py runserver