[pacman-dev] pyalpm/pycman -- how to check if a package is installed?
Hi, I'd like to use pyalpm and pycman in my project. I need to get the database. Unfortunately, when I run the code, I get an exception saying "data is not initialized". How to fix that?
Code (a segment) (imported: pyalpm pacman AUR argparse): db = pyalpm.get_localdb() pargs = db.get_pkg(dep) oargs = argparse.Namespace(package=False, quiet=False, info=0, listfiles=0) localInstalled = pycman.action_query.display_pkg(pargs, oargs) pyalpm.release()
On 2011/7/30 Kwpolska kwpolska@gmail.com wrote:
Hi, I'd like to use pyalpm and pycman in my project. I need to get the database. Unfortunately, when I run the code, I get an exception saying "data is not initialized". How to fix that?
Hello,
libalpm must be initialized and configured before working properly. pyalpm provides several helper functions in pycman.config to do the initialization through the /etc/pacman.conf file.
Rémy.
participants (2)
-
Kwpolska
-
Rémy Oudompheng