Setting the default installation location for pip
A somewhat alternative approach could be virtualenv, like this:
virtualenv path/to/your/storage/venv
then
source path/to/your/storage/venv/bin/activate
This last command transports you to your virtual environment, and while in there, anything installed via pip
will get installed in that directory, which can be on other device.
I would prefer this approach, because there's very little manual configuring required, but you would need to install virtualenv (it's about 2MB).
Related videos on Youtube
Jules
Expert Python programmer with experience working with the Linux network stack, REST APIs, and relational databases (and Postgres in particular). There's some devops experience in there too, but software dev is my preference. Not currently open to new work.
Updated on September 18, 2022Comments
-
Jules over 1 year
I'm working on a computer with extremely limited internal storage, so I want to set up pip and my Python environment so that new packages are installed to an SD card (which is going to be inside the machine all the time anyway) by default.
Does pip provide this kind of functionality?
-
magicandre1981 over 8 yearswhich OS do you use?
-
Jules over 8 years@magicandre1981 This is on Ubuntu 15.10.
-