pyenv python django install

install git

 

sudo apt-get install git

 Install dependencies

 

 

$ sudo apt-get install libc6-dev gcc

$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev
 libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm

 Install the pyenv management tool

 

 

$sudo curl -L https://raw.github.com/yyuu/pyenv-installer/master/bin
/pyenv-installer | bash

 Configuration Environment

 

 

$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(pyenv init -)"' >> ~/.bashrc
$ exec $SHELL -l

 View pyenv version

 

 

$ pyenv install --list

If you are sure to install python3.4.3, you can install python next. Before installation, we must install the dependencies required by python

$ sudo apt-get install libc6-dev gcc
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm

 After the above dependencies are completed, python can be installed 

$ pyenv install 3.4.3 -v

 After installation, you need to update the database command

$ pyenv rehash

 View currently installed pyenv

$ pyenv versions
* system (set by /home/seisman/.pyenv/version)
3.4.3

  Set the global python version

$ pyenv global 3.4.3
$ pyenv versions
system
* 3.4.3 (set by /home/seisman/.pyenv/version)

 confirm python version

Python 3.4.3 (default, Apr  6 2017, 15:10:14)
[GCC 5.3.1 20160413] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

 

install django 

Create a soft link first

ln -s /usr/bin/python3 /usr/bin/python

 Before installing django, pip should be installed first. pip is a software installation tool similar to yum, which can be used to easily install software

One of the ways to install pip is to use the get-pip.py script to install

wget https://bootstrap.pypa.io/get-pip.py

 After downloading, use local python to run the script

python get-pip.py

 Install django using pip

pip install Django==1.8.9

  Check django version

python -c "import django; print(django.get_version())"

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326755341&siteId=291194637