Get Canto

Debian/Ubuntu


Debian (sid) and Ubuntu (trusty, xenial through zesty) running AMD64 can add the following line to their sources.list to get canto. If there is demand for i386, I can start to generate for them as well (unfortunately the curses C extension is architecture dependent).

deb http://codezen.org/debian [sid|trusty|xenial|yakkety|zesty] main

That repo is signed with a key you can add:

curl https://codezen.org/static/canto-pub.gpg | sudo apt-key add -

After you’ve added the repo and key, just apt-get update and then install python3-canto-curses.

Gentoo


Gentoo has native packages, canto-daemon and canto-curses. Latest version isn’t guaranteed however.

Arch


Canto is available in the AUR, both canto-daemon and canto-curses as well as -git variants.

Tarballs


The latest release can be downloaded (.tar.gz) here:

daemon 0.9.7
curses 0.9.9

Tag snapshots for older releases are also listed.

daemon
curses

Git


The source for Canto is available on Github:

canto-next
canto-curses

Installation from Source


Installation of canto is quite simple and follows the standard paradigm for Python packages.

Dependencies


daemon:


  • Python 3
  • Python 3 – feedparser

curses:


Runtime

  • Python 3
  • readline
  • ncursesw

Build (on distros with separate dev header packages)

  • python3-dev
  • libreadline6-dev
  • libncurses5-dev
  • libncursesw5-dev
  • Standard build tools (build-essential, GCC, etc.)

Git Install


  1. git clone https://github.com/themoken/canto-next.git
  2. cd canto-next
  3. sudo python3 setup.py install
  4. cd ../
  5. git clone https://github.com/themoken/canto-curses.git
  6. cd canto-curses
  7. sudo python3 setup.py install

Tarball Install


  1. download or wget [canto-next tarball]
  2. tar -xvzf canto-next-[version].tar.gz
  3. cd canto-next-[version]
  4. sudo python3 setup.py install
  5. cd ../
  6. download or wget [canto-curses tarball]
  7. tar -xvzf canto-curses-[version].tar.gz
  8. cd canto-curses-[version]
  9. sudo python3 setup.py install

Installation from Source (no root access)

This assumes that you have Python 3 installed already. If not, then getting a working Python 3 installation is step one. This is beyond the scope of this little walkthrough, but the official Python 3 docs and Google should be helpful.

Python has good support for installation to user directories via setup.py.

Using python3 setup.py install --prefix=/path/to/some/directory you can install a Python package into a custom directory.

You still need all of the dependencies available, they’re listed in the previous section.

Build dependencies can be a bit tricky without root access. Requiring compilers and headers on something like a shared host can be a pain. Fortunately, if you do have access to a machine with the same architecture as your host (like your laptop or desktop) running Linux, you can do the installation step on your machine and then copy your custom root directory wherever you need.

Install canto to a custom directory

It may seem odd to install canto before its runtime dependencies, but canto’s setup.py is simple enough to create a directory hierarchy at the prefix, even if one doesn’t exist, where feedparser will fail unless there’s already a hierarchy in place.

Here’s the rootless install for installing to ~/canto-root:

  1. git clone https://github.com/themoken/canto-next.git
  2. cd canto-next
  3. python3 setup.py install --prefix=~/canto-root
  4. cd ../
  5. git clone https://github.com/themoken/canto-curses.git
  6. cd canto-curses
  7. python3 setup.py install --prefix=~/canto-root

Install runtime dependencies to a custom directory

For the runtime dependencies, ncursesw and readline are usually non-issues (they are usually pulled in by base packages on most distros).

For Feedparser, you can download from github and install with setup.py, just like Canto. It is a little pickier about your installation target being in your PYTHONPATH already.

NOTE: The PYTHONPATH change includes the Python version, you’ll have to change it (or just tab complete it since the directory should’ve been created by the Canto install).

  1. mkdir ~/canto-root
  2. git clone https://github.com/kurtmckee/feedparser.git
  3. cd feedparser
  4. export PYTHONPATH=”/path/to/canto-root/lib/python3.X/site-packages/:$PYTHONPATH”
  5. python3 setup.py install --prefix=~/canto-root

Now ~/canto-root has a full install of Canto and can be moved around if you need to.

Running Canto out of the custom directory

In your shell setup (like .bashrc) or in your terminal / script add the following:

export PATH="/path/to/canto-root/bin:$PATH"
export PYTHONPATH="/path/to/canto-root/lib/python3.[X]/site-packages:$PYTHONPATH"

Once again, note that PYTHONPATH has a version in it that you’ll have to change to be appropriate for your install.

This should allow you to run canto-daemon, canto-curses, and canto-remote as usual.

14 thoughts on “Get Canto

  1. When I add your repository on Debian Sid and try to install python3-canto-curses I get:
    python3-canto-curses : Depends: python3 (< 3.5) but 3.5.1-3 is installed
    I get that on three different Debian installations.
    I also tried to install python3.4 without getting different results.
    Is that (<3.5) strict dependence important or can it be lifted?
    Anyway, thanks for your great software.

    1. Yeah, one of the problems with serving debs and not *using* Debian: sid’s Python version gets bumped and I don’t notice.

      I should have fresh debs up in the next few hours, possibly with a new repo key too since I think I lost the GPG key I used to sign it with when my previous laptop drive died.

  2. Hey Jack. I’ve added your key as documented above. I check with apt-key list and it is there. I ran apt-get update and then apt-get install ptyhon3-canto-curses. But I get:
    WARNING: The following packages cannot be authenticated!
    python3-canto-daemon python3-canto-curses

    Also, since the last major update of apt it will complain that your key is weak.

    Cheers,
    Marcel

  3. Hi Jack,

    Thanks for Canto! I (Ubuntu 16.04) have, however, one problem with the installation process: After adding “deb http://codezen.org/debian xenial main” I get the following error message:

    “http://codezen.org/debian/dists/xenial/Release.gpg: Signature by key 6D4E5FDE18249AE7E64D5416BBCE7DB21AA83D96 uses weak digest algorithm (SHA1)
    E: Failed to fetch http://codezen.org/debian/dists/xenial/Release Unable to find expected entry ‘main/binary-i386/Packages’ in Release file (Wrong sources.list entry or malformed file)
    E: Some index files failed to download. They have been ignored, or old ones used instead.”

    I guess this error is due to the address given: Probably it should read “http://codezen.org/debian/xenial/” instead of “http://codezen.org/debian/dists/xenial/”?

    All best,
    Peter

    PS: Installing the packages manually works (after an “apt install -f”) fine.

  4. I was a regular user of canto version 0.6.13 and then an upgrade broke my canto.
    I had this older version launch in the OSX Terminal App and I could hit the key “g” and it would open a link in the Safari browser.

    I have just installed canto-next and canto-curses .
    However when I run canto-curses in Terminal App I see garbled text for one link and then it crashes with “Abort trap 6”

    http://imgur.com/s7DUx46

    If I run it on OSX Iterm2 app . It opens a fuller list of urls and this does not crash if I try my old shortcut “g” but looks similarly garbled.
    http://imgur.com/PeBNXpa

    It seems that one of the dependencies are malfunctioning. could you help me troubleshoot.
    Thanks

    1. I’m glad that you decided to update because 0.6 is positively ancient, but unfortunately I can’t support OSX because it’s not free software. My guess, just from looking at your mangled output, is that your ncurses library is either really old (I’m running 6.0 here) or it’s a version that doesn’t support widechars. I’d start by making sure you’re up to date there, and potentially looking at any errors or warnings when canto was built (as part of the setup.py install output).

      1. I upgraded to ncurses 6.0.2 using homebrew and ran the standard setup.py install and also tried installing to a non system directory . Maybe the correct ncursessw did not get linked because I am still seeing the same output.
        Thanks for your suggestion…Ill contrinue trying to get it to look right

  5. I’m trying to install canto on debian. I’ve added the repository to sources.list and added the key with apt-key. However when I apt-get update I get the following error:

    W: GPG error: http://codezen.org/debian sid Release: The following signatures were invalid: 6D4E5FDE18249AE7E64D5416BBCE7DB21AA83D96
    E: The repository ‘http://codezen.org/debian sid Release’ is not signed.
    E: Failed to download some files

    1. I think it was actually the digest algorithm, I set that to SHA512 and it seems to have resolved the issue, even using the same RSA2048 key. Should be fixed now.

  6. On Ubuntu 16.04 I still get:
    “http://codezen.org/debian/dists/xenial/Release.gpg: Signature by key 6D4E5FDE18249AE7E64D5416BBCE7DB21AA83D96 uses weak digest algorithm (SHA1)”

Leave a Reply

Your email address will not be published. Required fields are marked *