captain icon indicating copy to clipboard operation
captain copied to clipboard

Installation instructions

Open pepov opened this issue 12 years ago • 2 comments

Could you please provide installation instructions? What python version do I need, and how should I get the required packages like daemon? I've tried pip install daemon and python-daemon too but it misses pidlockfile:

$ ./captaind 
Traceback (most recent call last):
  File "./captaind", line 12, in <module>
    from daemon.pidlockfile import PIDLockFile
ImportError: No module named pidlockfile

pepov avatar May 01 '14 12:05 pepov

They appear to be using python-daemon 1.5.5 that depends on an older version of python-lockfile (0.8 at most), whereas pip installs python-daemon 1.6 (not sure why, 1.5.5 seems to be last official release on pypi) which requires lockfile 0.9, which however has changed the location of pidlockfile.

A backward compatible change would be to use the following patch to captaind (or install the old version of both python-daemon and lockfile):

diff --git a/captaind b/captaind
index 39e904d..1aafe6c 100755
--- a/captaind
+++ b/captaind
@@ -9,7 +9,10 @@ import eventlet
 import contextlib
 import logging.handlers

-from daemon.pidlockfile import PIDLockFile
+try:
+    from daemon.pidlockfile import PIDLockFile
+except ImportError:
+    from lockfile.pidlockfile import PIDLockFile

 from captain.server import Server

There's also a dependency on python-apt which I can't figure out how to install from pypi even though it seems to be listed. However, it's easy enough to have pip point at the git repository directly (beware you'll need to apt-get install libapt-pkg-dev too) by pip install git+git://anonscm.debian.org/apt/[email protected]

Perhaps they're testing this on an older version of debian/ubuntu (12.04 seems to have the correct dependency versions), in which case you can just apt-get install python-eventlet python-daemon python-apt to get everything you need.

ivgiuliani avatar May 03 '14 14:05 ivgiuliani

Thanks a lot, I was trying to install in a virtualenv using only pip, but it works out of the box using the debian packages on ubuntu 14.04 and on wheezy too!

pepov avatar May 05 '14 18:05 pepov