macOS Centos安装pyenv

macOS Sierra

mac自带 python 2.6,这里安装pyenv并安装3.6.0

$ brew update
$ brew install pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
$ echo 'eval "$(pyenv init -)"' >> ~/.zshrc
$ pyenv install 3.6.0 
$ pyenv versions
$ pyenv global 3.6.0 # 也可切换其他版本
$ pyenv versions
$ sudo easy_install pip  # 安装pip包管理工具

$ pip install itchat
$ pip install flask # 封装成web api

Centos64

安装pyenv 安装python3

$ yum install -y  gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel

$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv

$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile

$ pyenv install 3.6.0 
$ pyenv versions
$ pyenv global 3.6.0 # 也可切换其他版本
$ pyenv versions
$ pyenv rehash

$ pip install itchat
$ pip install flask # 封装成web api

你可能感兴趣的:(macOS Centos安装pyenv)