Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

List of packages installed via pip

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
teefax
n00b
n00b
Posts: 11
Joined: Wed Jan 14, 2015 1:33 pm
Location: Germany

List of packages installed via pip

  • Quote

Post by teefax » Wed Mar 16, 2016 1:03 pm

A while ago I installed a few packages via pip that weren't in portage at that time. However, now I would want to remove them but don't remember exactly what I installed.

I figured `pip list` would output all packages installed by pip but the resulting list is way to long an clearly wrong. Is there any way to generate a list of packages installed by pip / not managed by portage?
Top
Tatsh
Apprentice
Apprentice
Posts: 187
Joined: Sun Jul 22, 2007 4:48 am
Contact:
Contact Tatsh
Website

  • Quote

Post by Tatsh » Mon Apr 04, 2016 7:56 am

So, let's not do that again? Use a virtualenv whenever you need local packages of things that aren't in Portage. You can even direct link to the main script so you don't have to enter the virtualenv just to use it.

This, run as root, will show what packages are not handled by Portage. You can then examine the output and run `pip uninstall` (as root) on the package names.

Code: Select all

pip list | while read l a; do loc=$(pip show "$l" | fgrep Location | awk '{ print $2 }') && find "${loc}" '(' -name "${l}*" -o -name "${l//-/_}*" ')' | head -n 1 | xargs qfile >/dev/null || echo "$l"; done
(Explanation: Parse pip list, take first argument (called l), get the information, take the Location line, get the path, search for the path + package_name, pass the arguments to qfile. If qfile fails, echo the package name (it means it is not handled by Portage).)

If you get nothing for output, that means either an error occurred or Portage is managing all your files that would have come via Pip.
Top
Post Reply

2 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic