There are many similar versions of this question; however they all seem to be caused by different scenarios than my own, and the answers are not applicable here. Running Python 3.6.5.
venv does not install pip into new environments
When I use python3 -m venv new_env, pip should normally be installed in new_env/bin. However, in my case, this does not happen, and ls new_env/bin only contains the activate scripts and python/python3.
As a result, I am still on my system's pip, i.e. which pip produces:
/usr/bin/pip
and this version of pip cannot install into my virtual environment (I can't use it at all since I don't have the permissions to change the main system folders). Similarly, pip3 is in a different but still system-wide folder (company specific).
In contrast, running which python produces:
~/new_env/bin/python3
as it should.
python -m ensurepip doesn't work, as it detects that pip is already installed on my machine (and I don't have permission to reinstall it).
Leads to errors when trying to install packages
When trying to install new packages, pip will try to install in the system folders where you may not have permission, leading to errors such as:
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/somepath/lib64/python3.6/site-packages/numpy'
which may help people suffering from this problem to navigate to this question.
virtualenv does install pip
I can create a new virtual environment with
virtualenv -p python3 new_env
and this does install pip, setuptools, etc... as expected. This is a workaround for the problems above, but I still want to know why the above isn't working.