A virtualenv that suddenly takes two gigabytes often hides in a cache directory nobody looks at.
pip cache dir
pip cache info
pip cache purge
pip cache dir prints the location, pip cache info shows its size and the number of wheels, and pip cache purge deletes everything. pip cache list names the stored wheels and takes a pattern. The cache holds built wheels and HTTP responses, so the next install of a large package like numpy has to download or compile it again. In a Dockerfile, pip install --no-cache-dir keeps the image smaller. These subcommands need pip 20.1 or newer.
Further reading: pip documentation: pip cache
Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it