You are not logged in.

#1 2018-05-18 17:38:34

kinematik
Member
From: Seville, Spain
Registered: 2015-04-07
Posts: 8

[QUESTION] Best practices installing Python Packages

I am improving my python knowledge and finding an increasing problem: the system gets corrupted after the installation of many python packages, I lost my system using raspbian once, and two times I had to manually clear installed packages in Arch (much more robust :-) ).

It is clearly advised not to install packages mixing pacman and pip, but I would like to install them at the system, instead of user level (virtenv).

These are the choices as far as I know, in order to have an external package available:

  • PIP (Python Package)

  • VIRTENV - User level

  • PACMAN/Official: most of the packages are there, but I have found that

  • PACMAN/AUR: In AUR you can find most of the mixing packages, but not all of tehm. An example Facebook Prophet

  • CONDA - Really good reputation, but it is not open source?

How do you usually deal with many python packages?, any advice?

Offline

#2 2018-05-18 17:52:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,754
Website

Re: [QUESTION] Best practices installing Python Packages

I just use pacman/makepkg.  Anything that is availble on the cheese shop is trivially easy to make a PKGBUILD for if one isn't already in the AUR.

I have very limited expereince with Conda, and all that experience has been horrifically bad.  It strikes me as one of those tools that is designed to make things easy and idiot proof, but the end result is that anything that was already easy does become idiot proof, while anything that was even slightly more involved becomes either 1) impossible or 2) the reason the whole python ecosystem on the computer gets borked.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#3 2018-05-18 17:55:00

Maktm
Member
Registered: 2018-05-15
Posts: 2

Re: [QUESTION] Best practices installing Python Packages

Personally I just use virtualenv because it helps me contain the project *and* the dependencies inside of one folder. If I need to move the project, delete it etc. it's all contained so life is easy.

There have been a lot of complaints against virtualenv as of late but I haven't ran into any problems so far smile

Offline

#4 2018-05-18 17:55:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,906

Re: [QUESTION] Best practices installing Python Packages

My personal preference is to use pacman for everything at the system level, and pip for things at the local level used with a virtual environment


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2018-05-18 18:38:14

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [QUESTION] Best practices installing Python Packages

If you must use pip and you don't wish to use virtualenv, at least use pip install --user.

This is fully accessible to your user, but maintains separation between the system site-packages and the user site-packages, making it much easier to fix any terrible mistakes.

...

I'd very much recommend creating a PKGBUILD though, as they're very easy...


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2018-05-18 19:26:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,754
Website

Re: [QUESTION] Best practices installing Python Packages

Maktm wrote:

Personally I just use virtualenv because it helps me contain the project *and* the dependencies inside of one folder.

Well, not really.  Any commonly used dependency will not be in one directory, it could be in dozens of directories.

Install it with pacman and it will be in one directory, it will also be easy to cleanly remove all packages (that should be removed) with `pacman -Rns $top-level-pkg`.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

Board footer

Powered by FluxBB