{"action":"opened","issue":{"url":"https://api.github.com/repos/redQue/blog/issues/3","repository_url":"https://api.github.com/repos/redQue/blog","labels_url":"https://api.github.com/repos/redQue/blog/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/redQue/blog/issues/3/comments","events_url":"https://api.github.com/repos/redQue/blog/issues/3/events","html_url":"https://github.com/redQue/blog/issues/3","id":195702075,"number":3,"title":"pip","user":{"login":"redQue","id":5451446,"avatar_url":"https://avatars.githubusercontent.com/u/5451446?v=3","gravatar_id":"","url":"https://api.github.com/users/redQue","html_url":"https://github.com/redQue","followers_url":"https://api.github.com/users/redQue/followers","following_url":"https://api.github.com/users/redQue/following{/other_user}","gists_url":"https://api.github.com/users/redQue/gists{/gist_id}","starred_url":"https://api.github.com/users/redQue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redQue/subscriptions","organizations_url":"https://api.github.com/users/redQue/orgs","repos_url":"https://api.github.com/users/redQue/repos","events_url":"https://api.github.com/users/redQue/events{/privacy}","received_events_url":"https://api.github.com/users/redQue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-15T02:37:40Z","updated_at":"2016-12-15T02:37:40Z","closed_at":null,"body":"pip 是 Python 的包管理工具。\r\n\r\n\r\n## 安装 pip\r\n\r\n- Python3.4+\r\n  Python3.4 起附带 pip ，无需额外安装。\r\n\r\n- 低于 Python3.4 版本的 Python\r\n  - 到 [pip.pypa.io](https://pip.pypa.io/en/stable/installing/) 获取 `get-pip.py`\r\n  - 切换到 `get-pip.py` 所在目录\r\n  - 运行 `sudo python get-pip.py` 安装\r\n\r\n- Windows 用户\r\n  pip 会被安装在 Python 安装目录下的 Scripts 目录中。\r\n  把 `C:\\Python<version>\\Scripts` 添加到 PATH 中，就可以在命令行中使用 pip 了。\r\n\r\n\r\n---\r\n## 常用pip命令\r\n\r\n\r\n- **安装**  \r\n  - ` pip install  <package-name>`\r\n  - `pip install -r requirements.txt`\r\n\r\n- 列出可更新的包    `pip list --outdated`\r\n\r\n- **升级**    `pip install -U  <package-name>`\r\n\r\n- 卸载  \r\n  - `pip uninstall  <packag-name>`\r\n  - `pip uninstall -r requirements.txt`\r\n\r\n- 列出已安装的包    `pip list`\r\n\r\n- **向`requirements.txt`导出包列表**    `pip freeze > requirements.txt`\r\n\r\n- 查看特定包信息    `pip show <packag-name>`  \r\n\r\n- 查找包    `pip search  <query>`\r\n\r\n- 帮助  `pip help`\r\n\r\n- 下载而不安装    `pip install <packag-name> -d <dir>`\r\n\r\n- 打包    `pip wheel <packag-name>`\r\n\r\n\r\n## pip 使用示例\r\n\r\n- 安装 requests    `pip install requests`\r\n- 安装特定版本的 requests    `pip install requests==1.0` \r\n- 升级 requests    `pip install -U 'requests<=2.0'`  \r\n  _使用引号来规避 '<' 和 '>',防止发生预期外的状况_\r\n- 卸载 requests    `pip uninstall requests`\r\n\r\n\r\n---\r\n## 国内加速\r\n\r\n\r\n### 指定pip单次安装源\r\n\r\n`pip install <packag-name> -i <url>`\r\n- `V2EX`   http://pypi.v2ex.com/simple\r\n- `阿里云`  http://mirrors.aliyun.com/pypi/simple\r\n\r\n### 整体替换pip安装源\r\n\r\nwindows下，创建 `~/pip/pip.ini`\r\n\r\n```\r\n[global]\r\ntrusted-host=pypi.v2ex.com\r\nindex-url=http://pypi.v2ex.com/simple\r\n```\r\n\r\n---\r\n- <https://github.com/pypa/pip>\r\n- [Python Packaging User Guide](https://python-packaging-user-guide.readthedocs.org)\r\n- [Python Package Index](https://pypi.python.org)\r\n"}}
{"actor":{"display_login":"redQue"}}