How to use Pip and PyPI
来源:互联网 发布:淘宝卖家后台网址 编辑:程序博客网 时间:2024/06/04 00:42
原文链接:http://www.pythonforbeginners.com/basics/how-to-use-pip-and-pypi
Pip - Overview
The pip command is a tool for installing and managing Python packages, such as those found in the Python Package Index.
It’s a replacement for easy_install.
PIP Installation
Installing PIP is easy and if you’re running Linux, its usually already installed.
If it’s not installed or if the current version is outdated, you can use the package manager to install or update it.
On Debian and Ubuntu: $ sudo apt-get install python-pip
On Fedora: $ sudo yum install python-pip
If you are using Mac, you can simply install it through easy_install: sudo easy_install pip
PyPI - the Python Package Index
Now, when PIP is installed, we need to find a package to install.
Packages are usually installed from the Python Package Index.
The Python Package Index is a repository of software for the Python programming language.
Getting Started with PIP
Now, when we know what PIP is and we have it installed on the computer, let’s see how to use it.
To install a package from the Python Package Index, just open up your terminal and type in a search query using the PIP tool.
PIP - Commands
Just typing pip in your terminal, should give you the following output on the screen:
Usage: pip [options]Commands: install Install packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. list List installed packages. show Show information about installed packages. search Search PyPI for packages. zip Zip individual packages. unzip Unzip individual packages. bundle Create pybundles. help Show help for commands.
The most common usage for pip is to install, upgrade or uninstall a package.
PIP - Search
To search for a package, say Flask, type in the following: pip search Flask
You should see an output with all packages containing the name “Flask” and a description with that.
Flask-Cache - Adds cache support to your Flask applicationFlask-SeaSurf - An updated CSRF extension for Flask.Flask-Admin - Simple and extensible admin interface framework for FlaskFlask-Security - Simple security for Flask appsFlask - A microframework based on Werkzeug, Jinja2 and good intentions
Pip - Install a package
We can see that Flask is available.
Flask - A microframework based on Werkzeug, Jinja2 and good intentions
Let’s go ahead and install it pip install Flask
Pip - Show information
Flask is installed, let’s show information about our newly installed packages.
pip show Flask
Name: FlaskVersion: 0.10.1Location: /usr/local/lib/python2.7/dist-packagesRequires: Werkzeug, Jinja2, itsdangerous
Pip - Uninstall a package
If you want to uninstall a package installed by PIP, you can do that as well.
pip uninstall Flask
Uninstalling Flask:........Proceed (y/n)?Successfully uninstalled Flask
Using pip is easy and with it you can easily install packages from PyPI.
More Reading
https://pypi.python.org/pypi
http://www.pip-installer.org/en/latest/
http://flask.pocoo.org/
- How to use Pip and PyPI
- How to Install and Use Python Pip on Ubuntu 14.04 and pip install pytz
- How to install and use doxygen
- How to Create and Use the DLL
- How To Use Function 'F4_FILENAME' and 'KD_GET_FILENAME_ON_F4'
- standard exception and how to use
- How to use 'SetItemData()' and 'GetItemData()'?
- How to use the CONVERSION_EXIT_PARVW_INPUT and CONVERSION_EXIT_PARVW_OUTPUT
- How To Choose and Use Strong Passwords
- how to config and use apt-get
- What and How to use JSF
- How to use NSString and NSMutableString
- How to use appreciation and lie
- How to use calltree and Graphviz/CodeViz
- How to configure and use CAN bus
- How to use 'SetItemData()' and 'GetItemData()'?
- Why and How to Use Netlink Socket
- How to use tcpdump and Wireshark
- 十大经典排序算法小结
- 170411 VJ题解(3)(ZOJ
- 2787 加密术
- qt中获取打开文件路径,颜色对话框,字体对话框,自定义对话框,消息对话框,输入对话框
- UVa 815 Flooding!(排序)
- How to use Pip and PyPI
- [杂题] Codeforces Gym 101190 NEERC 16 K. Kids Designing Kids
- 动态规划练习一 23:大盗阿福
- win10 x64, python3.6+opencv 3.2
- [sdoi2017][bzoj4821] D2T3 相关分析
- 循环语法注意点
- Javascript面向对象(二)——setter、getter属性
- unix系统之acct()
- Android 客户端Socket 实现及简单封装。