Pyenv
Official library:https://github.com/pyenv/pyenv.git
1) Dependent environment
sudo apt-get install-y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget Curl LLV M Libncurses5-dev Libncursesw5-dev Xz-utils
2) Download
| Bash
3) Environment variables
# append the following to ~/.BASHRC (add to this file if there is ~/.bash_profile)
export path= "/home/whb/.pyenv/bin: $PATH"eval "$ (pyenv init-)"eval "$ (pyenv virtualenv-init-)"
$ source ~/.BASHRC (or ~/.bash_profile)
$ pyenv Install--list
Create a virtual runtime environment for Python [email protected]:~/mypython/projects/web$ pyenv virtualenv 3.6.6rc1 3.6.6vLooking in Links:/tmp/ Tmp5boe92t2requirement already Satisfied:setuptools in/home/whb/.pyenv/versions/3.6.6rc1/envs/3.6.6v/lib/ Python3.6/site-packages (39.0.1) requirement already SATISFIED:PIP in/home/whb/.pyenv/versions/3.6.6rc1/envs/3.6.6v /lib/python3.6/site-packages (10.0.1) [email protected]:~/mypython/projects/web$ pyenv versions system* 3.6.6rc1 (set B y/home/whb/mypython/projects/web/.python-version) 3.6.6rc1/envs/3.6.6v 3.6.6v[email protected]~:mkdir-p mypython/ Projects/web[email protected]~:cd mypython/projects/web[email protected]:~/mypython/projects/web$ pyenv Local 3.6.6v (3.6.6v) [email protected]:~/mypython/projects/web$ (3.6.6v) [Email protected]:~/mypython/projects/web$
Jupyter Notebook
Build an environment where python2 and Python3 coexist!
Installing Python and Python-pip--This is very critical, note Ipython3 and Ipython, Pip and PIP3, Python and Python3sudo apt-get install
ipython3 python-cycler-doc dvipng ffmpeg Inkscape python3-cairocffi python3-nose Pytho N3-pyqt4 python3-scipy Python3-sip python3-matplotlib
$ pip install --upgrade pip //更新pip
$ pip3 install --upgrade pip
Installing Jupyter-notebook
$ pip install jupyter$ pip3 install jupyter
Configuration can use both the Python2 and Python3 cores
( ipython and ipython3 is installed above)
$ ipython kernel install--user
$ ipython3 kernel install --user
$ python3 -m ipykernel install--user
$ python2 -m ipykernel install--user
$ pip install -U ipykernel
$ jupyter-notebook
Tkinter # If This fails your Python * is configured for TK workaround
install python3-tk (Ubuntu)>> yum install python3-tk (Centos)安装tk开发类库:>> sudo apt install tk-dev (Ubuntu)>> yum install tk-devel (Centos)
ubuntu18.0.4 Python development environment