jack-zheng
5/12/2018 - 11:43 AM

python, pipenv

python, pipenv

pipenv quick start

  • pip install pipenv #install lib
  • cd to project dir, pipenv --three/--two #new virtual env python3/2
  • pipenv install flask #安装 flask lib
  • pipenv shell #enable virtualenv, equals to 'source venv/bin/activate'
  • pipenv graph #show the package you installed
  • others, check by command: pipenv --help

set douban as source

HOME 下创建 .pip 文件夹, 再创建 pip.conf 文件, 内容如下:

[global]
timeout = 60
index-url = https://pypi.douban.com/simple
trusted-host = pypi.douban.com

if you want to enable this when you run command under admin permission, say: sudo pip install XX,
put this file under '/etc/pip.conf'

also, you can use it in this way to avoid add to 'etc' folder

# this is pretty cool, should be what I want.
pip install --user xxxxx

Install by special the source:

sudo pip install -i https://pypi.douban.com/simple/ flask

更多内容参见官方文档