You are not logged in.

#1 2017-02-07 08:56:09

oysteijo
Member
From: Stavanger
Registered: 2012-12-27
Posts: 13

[SOLVED] Python installation messed up! How to clean?

(Sorry if this is posted in the wrong forum, but I'm not sure which forum to post this on)
(Sorry if this post sounds like my whining, but I think I need some comfort and support.)

It all my own fault of course! I've enjoyed Arch, pacman and python for years now, but over the years, I've also been sloppy when it comes to python module installations. Some python packages have been installed with pacman, some packages have being installed from AUR, some packages has been installed with pip, and to make the mess complete, some packages has been installed using pipman. In /usr/lib I now have python2.7, python3, python3.5, and python3.6 directories, each with a site-packages, not necessarily a python installation.

This is my real punishment for not using virtualenv, I guess.

So... how do I clean up? This is a one user desktop system, so I'm not afraid of temporary uninstalling packages, but I do want to have a correct state of the package managers and the installed python modules. Can anyone help me suggest a clean up strategy? Thanks for any suggestion.

Last edited by oysteijo (2017-02-08 07:47:51)

Offline

#2 2017-02-07 10:06:04

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [SOLVED] Python installation messed up! How to clean?

Just "pacman -Qo" the folders in python3.5/site-packages/. If they are pacman packages, they must be from the AUR (because the main repos use python3.6 now), so reinstall them, which should put them in python3.6. The rest are probably pip packages, so reinstall them with pip3. Finally remove the python3.5 folder.

Offline

#3 2017-02-08 07:47:30

oysteijo
Member
From: Stavanger
Registered: 2012-12-27
Posts: 13

Re: [SOLVED] Python installation messed up! How to clean?

Thanks Morn, your trick became handy. I used a hard hand and removed the python3.4 and python3.5 packages with "pacman -Rcuss" which should really do a deep clean up of the stuff, I guess. Then I reinstalled the necessary packaged. Any leftover files and directories was removed by "sudo rm -rf *" (I love that commend... or do I?). "I will not use pip, I will not use pip, I will not use pip, ..."

Offline

#4 2017-02-12 16:36:20

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [SOLVED] Python installation messed up! How to clean?

Haha, this is an interesting topic. I think what you just described tends to happen with several modern programming languages: python, ruby, nodejs...

I think the best you can do is:

  • to try to use virtualenv + pip from now on the most you can.

  • Python packages should only be installed with pacman to fulfill package dependencies of another package in the repos.

  • Similarly, python packages in AUR should only be installed with pacman to fulfill package dependencies of packages in AUR.

sudo pip install, unfortunately, only clutters the filesystem -- without pacman's knowledge.

Offline

Board footer

Powered by FluxBB