For Blender 2.93.5, this is what worked for me:
Note: I'm on Linux (Manjaro), adjust accordingly. Also, I download and use Blender directly from its folder, along with its shipped version of Python. More on that below**.
Installing pip and packages:
Ensure pip is installed, using ensurepip - more on ensurepip
./path/to/blender-2.93.5-linux-x64/2.93/python/bin/python3.9 -m ensurepip
Note: ensurepip has an --upgrade flag, but I like upgrading the traditional way; see next step.
What about that -m flag?
Upgrade pip:
./path/to/blender-2.93.5-linux-x64/2.93/python/bin/python3.9 -m pip install -U pip
Install your package using pip via Python:
./path/to/blender-2.93.5-linux-x64/2.93/python/bin/python3.9 -m pip install packagename
Or install your package using pip directly:
./path/to/blender-2.93.5-linux-x64/2.93/python/bin/pip3 install packagename
Note: change packagename to an actual package name you'd like to install.
*Also note: running pip, pip3 or pip3.9 is all the same, in this case; under this context; but not if running directly from python (only use pip, in that case.) If you open these three files up in an editor you'll see they are "shortcuts" for calling the pip module.
** I like keeping separate version copies of Blender and directly using the version of Python that ships with them. I don't use the Blender from my package manager, in other words. This keeps things self contained and I don't have to mess with pyenv/virtualenv for the separate blender version of python or pollute my main system setups etc. Partly why I needed to know how to use pip directly from Blender in the first place.
Aside:
If you use VS Code to edit your python scripts for Blender and have Pylance installed, you can add this to your settings.json or *.code-workspace file:
"python.analysis.extraPaths": [
"./path/to/blender-2.93.5-linux-x64/2.93/scripts/modules",
"./path/to/blender-2.93.5-linux-x64/2.93/python/lib/python3.9/site-packages"
],
Used to specify extra search paths for import resolution.
source
This will turn off the warnings about not finding imports for bpy and pip installed packages, if any (adjust accordingly.)
Also, one might consider fake-bpy-module for code completions.