On 4/6/20 5:11 PM, Anil F Duggirala wrote: >> Python provides virtualenv, plus one can install most of the modules >> locally with pip3 install --user <blabla> which will install the >> modules >> in ~/.local/lib and tools in ~/.local/bin, so don't forget to add >> this >> to your PATH. >> > > Could you please explain (to a newbie) exactly what are the advantages > of using the --user option and the possible drawbacks as well? please > Could you tell me why I wouldn't want to use a virtualenv? Is it just > because of the pain of having to activate this virtualenv every time I > want to use those modules? or am I losing any other functionality > provided by my system-wide python? > I am surprised this question was asked 2 days ago, I had the exact same > question today. The numpy module is on version 1.16.2 in the debian > repositories and is on version 1.18.2 in pip. > thank you, >
virtualenv makes you flexible, you can have completely different environments isolated from each other. For example Debian Buster comes with python3.7 and you for whatever reason need python 3.4 or 3.8, or maybe both because of let's say application requirements. This would work with different envs. Installing modules with --user is easier but this way you have 1 environment in your home bound to the system python. Not every package in Debian can easily be updated. Updating numpy system-wide most likely will break tons of other software. But the same applies to pip to some extent, you may have a module requiring an old numpy which wouldn't work with the new one and so on.