CentOS 6.9

Installation dependency

yum install git gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip2-devel -y

sudo apt update
sudo apt install make build-essential libssl-dev zlib1g-dev
sudo apt install libbz2-dev libreadline-dev libsqlite3-dev wget curl
sudo apt install llvm libncurses5-dev libncursesw5-dev


useradd python
passwd python
su python

Switch to the newly created user

Install pyenv

curl -L | bash

Continue execution:

pyenv update

Configuring system variables:

vi .bashrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
source ~/.bashrc

Configure for pyenv

Install the new python and see the version that can be installed:

pyenv install --list

Continue execution:

pyenv install 3.5.3
mkdir py3
cd py3
pyenv local 3.5.3

The isolated installation package is in this directory:


Create a virtual python environment

pyenv virtualenv 3.5.3 gz

Post-installation tips:

Requirement already satisfied: setuptools in /home/python/.pyenv/versions/3.5.3/envs/gz/lib/python3.5/site-packages
Requirement already satisfied: pip in /home/python/.pyenv/versions/3.5.3/envs/gz/lib/python3.5/site-packages

Continue execution:

pyenv versions

You can see the set information.

Continue execution:

pyenv local gz

Entering this directory, you enter the virtual environment.

Install ipython using pip

cd ~
mkdir .pip
cd .pip
vi pip.conf

Put the following content in the file.


Finish the created virtual directory and install ipython.

cd /home/python/py3
pip install ipython

Enter ipython to enter.

Install jupyter

pip install jupyter

Use jupyter notebook --help this command to view help,You need to set a password for jupyter.

jupyter notebook password gongzifu

Start jupyter

jupyter notebook --ip= --no-browser

Open jupyter in your browser: