Python multi-version and various package management Python packages manage versions of Python version management
Because Python has 2.x and 3.x two large versions, and each project to build a variety of packages used in different versions (such as flask1.x), which makes a number of engineering development on the same host to complete the trouble (the project is not done by one person to complete, different people's configuration version is not the same, for all developers to successfully develop, It is necessary to make the development environment consistent, while one person may participate in several engineering developments.
Pyenv manages versions of Python.
Virtualenv manages the version of the package in the Python project (or the execution environment of the Python project).
But now pyenv-virtualenv integrates the VIRTUALENV function, in general, the use of pyenv can be.
Anaconda and virtualenv are almost the same, but they are more focused on scientific computing, so many scientific computing packages can be managed by Anaconda.
Preparation conditions for the management readiness installation of Python versions and packages
- 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 \
- Xz-utils Tk-dev
PYENV Installation
Manage third-party libraries with Anaconda using the PYENV Management system version.
- (1) Select Install to $home/.pyenv directory (but you can install the other one somewhere).
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
- (2) Configuring environment variables
echo ' Export pyenv_root= ' $HOME/.pyenv ' >> ~/.BASHRC
echo ' Export path= ' $PYENV _root/bin: $PATH "' >> ~/.BASHRC
- (3) Add pyenv Initialize to your shell
Echo ' eval ' $ (pyenv init-) "' >> ~/.BASHRC
SOURCE ~/.BASHRC
Pyenv using commands
- Showing a version of Python, Anaconda-2 supports python2.6 and 2.7 anaconda-3 support python3.3 and 3.4
- [Email protected]:~$ pyenv Install--list
- Available Versions:
- 2.1.3
- 2.2.3
- 2.3.7
- 2.4
- 2.4.1
- 2.4.2
- 2.4.3
- 2.4.4
- 2.4.5
- Install and uninstall a version of Python
- Pyenv install-v 2.7.5
- Pyenv Uninstall 2.7.5
- RM-RF ~/.pyenv/versions/2.7.5 # #移除版本2.7.5
- Pyenv versions
- Pyenv Local 2.7.5 # #局部文件下版本切换
- Pyenv Global 3.3.5 # #全局系统下的版本切换
Anaconda use of scientific computing packages:
- Installation of Anaconda Scientific Computing package via pyenv
- Pyenv Install Anaconda
Python multi-version and various package management