• 欢迎浏览“String me = Creater\忠实的资深Linux玩家;”,请文明浏览,理性发言,有侵犯你的权益请邮件我(creater@vip.qq.com).
  • 把任何的失败都当作一次尝试,不要自卑;把所有的成功都想成是一种幸运,不要自傲。
  •    10个月前 (11-27)  Linux Linux应用 |   抢沙发  16 
    文章评分 0 次,平均分 0.0

    Installation

    Do I need to install pip?

    pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 binaries downloaded from python.org, but you'll need to upgrade pip.

    Additionally, pip will already be installed if you're working in a Virtual Environment created byvirtualenv or pyvenv.

    Installing with get-pip.py

    To install pip, securely download get-pip.py[2]

    Then run the following:

    <span class="n">python</span> <span class="n">get</span><span class="o">-</span><span class="n">pip</span><span class="o">.</span><span class="n">py</span>
    

    Warning

    Be cautious if you're using a Python install that's managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.

    get-pip.py will also install setuptools [3] and wheel, if they're not already. setuptools is required to install source distributions. Both are required to be able to build a Wheel Cache (which improves installation speed), although neither are required to install pre-built wheels.

    Note

    The get-pip.py script is supported on the same python version as pip. For the now unsupported Python 3.2, an alternate script is available here.

    get-pip.py options

    --no-setuptools
    If set, don't attempt to install setuptools

    --no-wheel
    If set, don't attempt to install wheel

    Additionally, get-pip.py supports using the pip install options and the general options. Below are some examples:

    Install from local copies of pip and setuptools:

    <span class="n">python</span> <span class="n">get</span><span class="o">-</span><span class="n">pip</span><span class="o">.</span><span class="n">py</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">index</span> <span class="o">--</span><span class="n">find</span><span class="o">-</span><span class="n">links</span><span class="o">=/</span><span class="n">local</span><span class="o">/</span><span class="n">copies</span>
    

    Install to the user site [4]:

    <span class="n">python</span> <span class="n">get</span><span class="o">-</span><span class="n">pip</span><span class="o">.</span><span class="n">py</span> <span class="o">--</span><span class="n">user</span>
    

    Install behind a proxy:

    <span class="n">python</span> <span class="n">get</span><span class="o">-</span><span class="n">pip</span><span class="o">.</span><span class="n">py</span> <span class="o">--</span><span class="n">proxy</span><span class="o">=</span><span class="s2">"[user:passwd@]proxy.server:port"</span>
    

    Upgrading pip

    On Linux or macOS:

    <span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">U</span> <span class="n">pip</span>
    

    On Windows [5]:

    <span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">U</span> <span class="n">pip</span>
    

    Python and OS Compatibility

    pip works with CPython versions 2.6, 2.7, 3.3, 3.4, 3.5 and also pypy.

    This means pip works on the latest patch version of each of these minor versions (i.e. 2.6.9 for 2.6, etc). Previous patch versions are supported on a best effort approach.

    pip works on Unix/Linux, macOS, and Windows.


    [1] For Python 2, see https://docs.python.org/2/installing, and for Python3, see https://docs.python.org/3/installing.
    [2] "Secure" in this context means using a modern browser or a tool like curl that verifies SSL certificates when downloading from https URLs.
    [3] Beginning with pip v1.5.1, get-pip.py stopped requiring setuptools to be installed first.
    [4] The pip developers are considering making --user the default for all installs, including get-pip.pyinstalls of pip, but at this time, --user installs for pip itself, should not be considered to be fully tested or endorsed. For discussion, see Issue 1668.
     

    除特别注明外,本站所有文章均为String me = "Creater\忠实的资深Linux玩家";原创,转载请注明出处来自http://unix8.net/home.php/5730.html

    关于

    发表评论

    暂无评论

    切换注册

    登录

    忘记密码 ?

    切换登录

    注册

    扫一扫二维码分享