補充:pipenv
===
安裝與配置
```
apt-get install python-pip -y
pip3 install pipenv
python3 -m site --user-base
配置bin到path
vim ~/.profile
source ~/.profile
```
### 基礎操作
```
pipenv --python 3
# 配置阿里源
python -c "s='https://mirrors.aliyun.com/pypi/simple';fn='Pipfile';pat=r'(\[\[source\]\]\s*url\s*=\s*\")(.+?)(\")';import re;fp=open(fn, 'r+');ss=fp.read();fp.seek(0);fp.truncate();fp.write(re.sub(pat, r'\1{}\3'.format(s), ss));fp.close();print('Done! Pipfile source switch to:\n'+s)"
# 安裝插件
pipenv install flask
# 進入虛擬環境shell
pipenv shell
# 查看當前項目包依賴關系
pipenv graph
# 退出shell
exit
# 安裝開發專用包
pipenv install --dev requests
```
### 團隊共享
```
# 拷貝pipfile
# 安裝依賴庫,包括開發依賴
pipenv install -dev
pipenv shell
pip list
exit
pipenv --venv
# 刪除虛擬環境
pipenv --rm
pipenv --venv
````
### 運行腳本
```
pipenv run python main.py
```