I'm currently using miniconda and I want to prevent myself and other users of my machine from installing anything into the base
environment. This is because I want users to be creating virtual environments and installing stuff there. I also don't want my base environment to get bloated.
Is there anyway to do this? I use both conda and pip so I imagine I need to somehow block both of those.
One option would be to change the write permissions on the directories pip and conda install packages to for the base environments. These locations vary based on your distribution, but you can check by using something like python -c "import setuptools; print(setuptools.__file__)"
. The parent directory to setuputils
will be where the packages get installed by default. Run chmod -w <packages dir>
to remove write permissions. You can always add them back with chmod +w <packages dir>
later, but while they're disabled this should keep you from installing packages there by accident. Unless you haphazardly install packages with sudo
, that is...