Install pip
安装 pip
Pip (Python Package Installer), official documentation for pip.
pip(python第三方程序安装器),官方地址official documentation for pip.
Usually Python3 comes with pip preinstalled.
一般来说,在安装Python3时,pip随python3一起安装了。
If you get an error "pip command not found", use the following command to install pip:
如果你看到如下错误"pip command not found", 使用如下的命令进行pip的安装
在Mac 的terminal 输入
sudo easy_install
pip Install virtualenv
virtualenv is a tool to create isolated Python projects. Think of it, as a cleanroom, isolated from other veresions of Python and libriries.
Virtualenv 是一个python的开发环境,它为每个python项目创建一个独立的开发环境。 想想,作为一个干净的环境,完全独立于不同的python版本和库。
Enter this command into terminal
进入terminal
sudo pip install virtualenv
or if you get an error
如果报错
sudo -H pip install virtualenv
Start virtualenv
使用virtualenv
Navigate to where you want to store your code. Create new directory.
用terminal进入你存储代码的地方。建立文件夹
mkdir my_project && cd my_project
INSIDE my_project folder create a new virtualenv
在my_project文件夹,建立virtualenv虚拟开发环境
virtualenv env
Activate virtualenv 激活
source env/bin/activate