Skip to content

Installing from github or local checkout (non root installation)

Thomas G edited this page Dec 14, 2015 · 6 revisions

This page describes how you can install udiskie into a virtual environment (no root permissions required). This is useful to quickly test new development branches or the most recent master commit without having to install udiskie on the system level. This article is mainly targeted at users of archlinux but may be useful for others as well.

Dependencies

First, install udiskie's dependencies. This can be done by first installing udiskie from the archlinux community package and then immediately uninstalling it but leaving its dependencies:

sudo pacman -S udiskie
sudo pacman -R udiskie

If you want to do it the hard way:

# minimum requirements:
sudo pacman -S udisks2 python-gobject

# recommended:
sudo pacman -S gtk3 libnotify gettext

# a notification daemon (if you haven't already)
sudo pacman -S xfce4-notifyd

Note that udiskie depends furthermore on the pyyaml and docopt python packages but these don't need to be installed via pacman: The udiskie installation script can resolve these dependencies automatically and install them locally into the virtualenv.

Remove global installation

If you have a system-level udiskie installation, remove it to make ensure that the local version will be loaded instead of the global one. I can't reproduce this issue right now, but I believe this has happened to me a few times. On archlinux:

sudo pacman -R udiskie
sudo pip uninstall udiskie

Prepare a virtualenv

If not already installed, get virtualenv:

sudo pacman -S python-virtualenv

Now we finally get to working with commands that do not require any root access anymore. First, create and activate a virtualenv as follows:

virtualenv TESTENV --system-site-packages
source TESTENV/bin/activate

Install the following python packages (optional):

pip install keyutils    # for caching passwords

Install udiskie

Reactivate the virtualenv if you deactivated it or opened a new terminal session:

source TESTENV/bin/activate

Now there are several options, depending on your needs.

  • To instruct your python to load udiskie from a local working directory every time (i.e. any changes you make to the code will be visible immediately without re-installing), proceed as follows:

      git clone git://github.com/coldfix/udiskie -b master
      cd udiskie
      python setup.py develop
    
  • If you want to have a static udiskie installation from a local checkout (i.e. changes will not be visible until you update/re-install udiskie):

      git clone git://github.com/coldfix/udiskie -b master
      cd udiskie
      python setup.py install
    
  • To install udiskie directly from github without adding a local checkout, type:

      pip install git+git://github.com/coldfix/udiskie@master
    

Run udiskie

In new terminal sessions don't forget to activate the virtualenv, then just type:

udiskie