4

I wish to PREVENT users from running pip to install packages into their home directory.

I have a fairly large number students who have network mounted home directories and file and space quotas on their directories.

I want to be able to allow them access to the system python / anaconda, but to prevent them from using pip to install things themselves. A huge amount of teaching time is wasted during unpicking things students have installed and unlocking their accounts because they've filled their home directory with pip-installed software.

Any suggestions would be greatly appreciated.

  • You can install pip with anaconda, so if they can use anaconda I don't think it will be easy blocking pip for them.. You could give them an environment.yaml which they install with conda, and then tell them not to install anything anymore afterwards? – Maarten-vd-Sande Nov 04 '19 at 19:59
  • Alas, asking them not to do it doesn't really help. Lab demonstrators have wasted hours trying to find problems in a student's code only to discover a mutant and mangled versions of numpy used in preference to the system version. Home directories get backed up off-site, so unless you spend the time de-duplicating, tapes are littered with 100s of copies of the same things each of the desktops already had. – exquisite spam Nov 04 '19 at 20:12
  • I have no experience with giving courses like such, but I think actually this is quite a bad idea. Giving students the power to change the shared environment can be really bad (for instance going from python2 to python3). One changed version will make everyone's code unexecutable... – Maarten-vd-Sande Nov 05 '19 at 13:57

1 Answers1

3

Nothing will be 100% effective. But here are some ideas...

  • Use a global configuration for pip with an index-url purposefully wrong.
  • Do not install pip or remove the executable bit.
  • Use a proxy to block access to pypi.org.
sinoroc
  • 9,658
  • 1
  • 13
  • 39