Search This Blog

Thursday, November 22, 2018

Install pip

  1. Download the installation script from pypa.io:
    $ curl -O https://bootstrap.pypa.io/get-pip.py
    The script downloads and installs the latest version of pip and another required package named setuptools.
  2. Run the script with Python:
    $ python get-pip.py --user
  3. Add the executable path to your PATH variable: ~/.local/bin
    To modify your PATH variable (Linux, macOS, or Unix)
    1. Find your shell's profile script in your user folder. If you are not sure which shell you have, run echo $SHELL.
      $ ls -a ~ . .. .bash_logout .bash_profile .bashrc Desktop Documents Downloads
      • Bash – .bash_profile.profile, or .bash_login.
      • Zsh – .zshrc
      • Tcsh – .tcshrc.cshrc or .login.
    2. Add an export command to your profile script.
      export PATH=~/.local/bin:$PATH
      This command adds a path, ~/.local/bin in this example, to the current PATH variable.
    3. Load the profile into your current session.
      $ source ~/.bash_profile
  4. Verify that pip is installed correctly.
    $ pip --versionpip 9.0.1 from /home/ruz/.local/lib/python2.7/site-packages (python 2.7)