There are plenty of situations where the details differ, sometimes
dramatically, of course, but in general David's advice is the best way
to go about things:
On 2020-03-16 14:37 +1100 (Mon), David Lyon wrote:
> I really suggest to stay with PIP :-) There is too much package dependency
> in the Python system to make it worth deviating from PIP. Things will go
> wrong, quickly, and you'll end up in a rabbit hole.
My general strategy divides the environment into three layers:
1. The Python interpreter itself, and packages installed with it. This
is generally:
a. a version of Python installed with pythonz[1] and _no_
packages (just the standard library that comes with Python);
b. a system Python that comes with your Linux distribution plus
only whatever additional packages are needed for programs
installed by your Linux package manager (which you generally
ignore); or
c. a standard install of Python on Windows and the `py` launcher[2]
to invoke it.
2. A --user install of pip, virtualenv and virtualenvmanager, anad
their dependencies, and nothing else. (Note that I try to keep pip
out of the interpreter installs above.
3. Virtualenvs for everything else, as part of the project when I'm
working on a project (see cpd[3] for an example) or with
virtualenvmanager for everything else (e.g., when I want to use
the AWS command-line tool).
There will no doubt be situations where you can't or find it terribly
inconvenient to do this, but if you can do this then I've found it to
cause the fewest problems with interactions between separate projects
and programs.
[1]:
https://github.com/saghul/pythonz
[2]:
https://docs.python.org/3/using/windows.html#launcher
[3]:
https://github.com/dot-home/cpd