Question: Blender comes with Python, and includes a stand-alone Python executable.
However pip is not part of the official Python distribution so it needs to be added separately.

* How do you setup `pip` with Blender's bundled Python so it can be used to install Python packages from [Pypi](https://pypi.org/) which are then available from inside Blender?
* How would you use it to install a package?

---

Note, this is related to [this question](https://blender.stackexchange.com/questions/14489/), but not a duplicate since its not about using pip as a library.

Answer: 
I'm on 2.82 on Ubuntu. I also have python 3.7, the same one Blender 2.82 requires installed on my system(and, yes, Blender still has its own Python bundled).
If I run the following from inside Blender:

```
>>> import sys
>>> sys.path
['/snap/blender/37/2.82/scripts/startup', '/snap/blender/37/2.82/scripts/modules', '/snap/blender/37/2.82/python/lib/python37.zip', '/snap/blender/37/2.82/python/lib/python3.7', '/snap/blender/37/2.82/python/lib/python3.7/lib-dynload', '/home/yuranos/.local/lib/python3.7/site-packages', '/snap/blender/37/2.82/python/lib/python3.7/site-packages', '/snap/blender/37/2.82/scripts/freestyle/modules', '/snap/blender/37/2.82/scripts/addons/modules', '/home/yuranos/.config/blender/2.82/scripts/addons/modules', '/snap/blender/37/2.82/scripts/addons']

```

As you can see there's `/home/yuranos/.local/lib/python3.7/site-packages`, which is my system location, not Blender-specific. Hence I can install libs with my global `python3.7` and have them available inside Blender right away.
Seems you don't really need to bother about installing a separate pip as long as the global and the Blender version of Python match.
Here is the main function, where the full solution (python 3) for windows/mac/linux can be found [here](https://github.com/pelednoam/mmvt/blob/master/src/misc/install_blender_reqs.py):

```
def install_blender_reqs(blender_fol='', gui=True):
    if blender_fol == '':
        blender_fol = find_blender()
    blender_parent_fol = get_parent_fol(blender_fol)

    # Get pip
    bin_template = op.join(get_parent_fol(blender_fol),  'Resources', '2.7?', 'python') if is_osx() else \
        op.join(blender_fol, '2.7?', 'python')
    blender_bin_folders = sorted(glob.glob(bin_template))
    if len(blender_bin_folders) == 0:
        print("Couldn't find Blender's bin folder! ({})".format(bin_template))
        blender_bin_fol = ''
        choose_folder = gui_input('Please choose the Blender bin folder where python file exists', gui) == 'Ok'
        if choose_folder:
            fol = choose_folder_gui(blender_parent_fol, 'Blender bin folder') if gui else input()
            if fol != '':
                blender_bin_fol = glob.glob(op.join(fol, '2.7?', 'python'))[-1]
        if blender_bin_fol == '':
            return
    else:
        # todo: let the user select the folder if more than one
        blender_bin_fol = blender_bin_folders[-1]
    python_exe = 'python.exe' if is_windows() else 'python3.5m'
    current_dir = os.getcwd()
    os.chdir(blender_bin_fol)
    pip_cmd = '{} {}'.format(op.join('bin', python_exe), op.join(GET_PIP_FOL, 'get-pip.py'))
    if not is_windows():
        run_script(pip_cmd)
        install_cmd = '{} install {}'.format(op.join('bin', 'pip'), REQS)
        run_script(install_cmd)
    else:
        install_cmd = '{} install {}'.format(op.join('Scripts', 'pip'), REQS)
        print(
            'Sorry, automatically installing external python libs in python will be implemented in the future.\n' +
            'Meanwhile, you can do the following:\n' +
            '1) Open a terminal window as administrator: ' +
            'Right click on the "Command Prompt" shortcut from the star menu and choose "Run as administrator"\n' +
            '2) Change the directory to "{}".\n'.format(blender_bin_fol) +
            '3) Run "{}"\n'.format(pip_cmd) +
            '4) Run "{}"\nGood luck!'.format(install_cmd))
    os.chdir(current_dir)

```

On Windows, you need admin privileges, to the one needs to do it manually.