how should an (ordinary) user install Leo on Linux?

122 views
Skip to first unread message

Josef

unread,
Nov 22, 2017, 7:03:47 AM11/22/17
to leo-editor
Although I used python occasionally since version 1.3, programming is not my main occupation.
So far I have installed leo from git, but I am missing a straightforward way to configure it on my Xubuntu 16.04 machine.

I do not know how to create a new mime type for it and associate it with leo (it's easy to associate it with an existing mime type, but I do not want to open all XML files with Leo).
The mime type editor, that comes with xubuntu does not seem to allow adding a new type!

I do not know what all the dependencies are, therefore I have currently viewrendered not working.

The Leo Debian package sources from Ville Vaino are for the jaunty version of Debian and do not seem to load in Xubuntu 16.04.

I think it would be nice to be able install and configure Leo without too much hassle at least on the Ubuntu LTS versions and derivates, e.g. Xubuntu, Kubuntu, ...
Ideally that would mean a matching .deb package, but I would be happy with a good set of instructions.

Chris George

unread,
Nov 22, 2017, 7:48:58 AM11/22/17
to leo-e...@googlegroups.com
Hello Josef,

I am a writer and a longtime Linux Mint user. I recently switched to Chakra as Mint dropped KDE. I am not a programmer.

I have been using Leo for ten years as my primary editor. (Wow, time flies).

Here is how I install Leo.

1. Install the latest Anaconda from here: https://www.anaconda.com/download/#linux

I use the python 3 version. I am not a programmer so it doesn't matter to me. The latest version of anaconda comes with anaconda-navigator, an excellent utlity that helps manage what is installed and what is not and simplifies setting up a python environment including different versions of python and pyQT. I have had so many bad experiences with the python installed by distributions that anaconda has sorted out that I have learned to start with anaconda instead of monkeying with .deb packages and python.

2. Install the prerequisites for Leo. These I usually install using pip or the package manager in the distribution. Try pip first.

docutils, pandoc, pyxml, pyenchant, git

3. Install Leo.

Open a terminal in your home directory. git clone https://github.com/leo-editor/leo-editor.git

4. Configure environment.

I use a shell script to run Leo from my home directory to run Leo. I always open Leo from a terminal as often valuable information is displayed in the terminal that doesn't show anywhere else.

    #!/bin/bash
    cd leo-editor
    git pull
    ./launchLeo.py --session-restore --session-save

I have never tried to associate .leo files or .db files with Leo. In a decade I have actually only ever used three actual files: myLife.leo (my organizer), writing.leo (small projects, like articles, websites etc.), and novel.db, the book I am working on. I have generated over a thousand text files using @file and @clean from these .leo files.

In general, try to stay away from the package manager in your distribution when it comes to python and QT. Anaconda is your friend. :-)

Hope this helps,

Chris

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscribe@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Josef

unread,
Nov 22, 2017, 11:30:39 AM11/22/17
to leo-editor
Hi Chris,

thanks for the tips. In fact, I have installed Leo in a pretty similar way as you (and I also use Leo already for several years). My problem was the file association, which you avoided.

Also, for a while I was not able to use the viewrendered plugin any more, and I am surprised you recommend Anaconda for the PyQt installation. I use miniconda3 which is essentially the same as anaconda, only the files are not downloaded right away. Installing PyQt5 does not deliver all PyQt packages needed for the viewrendered plugin, e.g. the WebKitWidgets seem to be missing. Is the viewrendered plugin working for you?

- Josef

Josef

unread,
Nov 22, 2017, 12:02:51 PM11/22/17
to leo-editor


2. Install the prerequisites for Leo. These I usually install using pip or the package manager in the distribution. Try pip first.

docutils, pandoc, pyxml, pyenchant, git

thank you for the tip. Installing docutils seems to have fixed my problem with the viewrendered plugin. 

- Josef 

Chris George

unread,
Nov 22, 2017, 12:26:41 PM11/22/17
to leo-e...@googlegroups.com
I never use viewrendered except to read about plugins. :-)

Chris

--

Matt Wilkie

unread,
Nov 22, 2017, 3:20:00 PM11/22/17
to leo-e...@googlegroups.com
Thanks for the recipe Chris. Steps 2 & 3 are about to get a whole lot easier, pending resolution of issue # 586 which I'm nearing the end of.

With regard to dependencies, do you recall what docutils, pyxml, and pyenchant required for? I don't have them in my list, but haven't seen any errors about them either.

Matt

Matt Wilkie

unread,
Nov 22, 2017, 3:29:05 PM11/22/17
to leo-e...@googlegroups.com
With regard to dependencies, do you recall what docutils, pyxml, and pyenchant required for? I don't have them in my list, but haven't
seen any errors about them either.

Nevermind, answered a couple myself, and am starting new thread to collect all dependencies

Matt

Josef

unread,
Nov 23, 2017, 8:57:17 AM11/23/17
to leo-e...@googlegroups.com
I figured out how to create a new mime type for Leo, which is a prerequisite for the file association in Linux:

Create a file, named leo-outline.xml with the following content:

<mime-type type="application/x-leo-outline">
<comment>leo-outline file</comment>
<glob pattern="*.leo"/>
</mime-type>
</mime-info>

now, run:

  xdg-mime install leo-outline.xml

That will install the mime type for the current user. If you want it system-wide, do it as superuser.

Now, look for the Leo icon. I found it in the Leo git folder: 

  leo/Icons/application-x-leo-outline.png

cd to leo/Icons and run:

  xdg-icon-resource-install --context mimetypes --size 32 application-x-outline.png application-x-leo-outline

Note, the last parameter "application-x-leo-outline" must match the "application/x-leo-outline" in the leo-outline.xml file.

After this you should have the icon associated with *.leo files.

Matt Wilkie

unread,
Nov 24, 2017, 12:26:46 AM11/24/17
to leo-e...@googlegroups.com
a mime-type will be welcome, thank you

rvn...@tesco.net

unread,
Nov 26, 2017, 5:01:23 PM11/26/17
to leo-editor
I think that the suggested method of installing anaconda is not the optimal way to facilitate this; it should be python-simple:
 
1) the user does not necessarily learn what exactly gets installed on his/her system
2) it creates an overload in case people are not needing all included packages (if people are not using leo for python programming and do not need access to ipython, scipy, numpy, matplotlib etc; anaconda is overload)
3) it bypasses the possibility of providing distribution-specific installs which often are guided by specific guidelines
4) the possibility of installing leo as a python program should be kept python-KISS, that is via python-install methods like pip (which will sort out required dependencies) or setup.py 
5) a setup.py is the standard way of installing a python program and used by distribution-specific install-scripts that enable keeping track of what is installed. Pip makes this more obscure so that it is important that a setup.py file is present and up-to-date

What is important is that configuration on a linux system can become more straightforward than it currently is, that is via use of the leoSettings. For example, all menu-related settings to open a file using another editor is windows-specific. This can be changed, as I am learning now, by copying the @settings/Menu/Open With-node from leoSettings.leo to myLeoSettings.leo file and overwrite the windows-specific bits with linux specific paths/executables. But it would be helpful if not each linux user has to do this for him/her self. This has been picked up and is addressed in leo-editor/issues/596

The mime-type script is interesting; thanks. I found full instructions for applying this here: www.freedesktop.org/..AddingMIMETutor/ . Together with a .desktop file, this could be a nice addition as part of the leo distribution and then, together with the leo.desktop file (like attached) being installed by the distribution according to its own guidelines.

PS I am on Slackware linux where we use for each application a script (a so called SlackBuild) to compile and install the program; this enables maintainers to copy files to particular places when needed (like the leo.desktop to /usr/share/applications and leo.mime to /usr/share/mime/packages). The currently used version is on https://slackbuilds.org/repository/14.2/development/leo/ 


cheers,

rob
leo.desktop

Edward K. Ream

unread,
Nov 27, 2017, 7:12:12 AM11/27/17
to leo-editor
On Sun, Nov 26, 2017 at 12:56 PM, <rvn...@tesco.net> wrote:
I think that the suggested method of installing anaconda is not the optimal way to facilitate this;

​I mostly disagree, as I have just explained in another reply.

5) a setup.py is the standard way of installing a python program and used by distribution-specific install-scripts that enable keeping track of what is installed. Pip makes this more obscure so that it is important that a setup.py file is present and up-to-date

​Leo is an app, not a python package.  I would like to see setup.py disappear completely.  Perhaps Matt has already done that as a result ​of his work creating a linux package.


What is important is that configuration on a linux system can become more straightforward than it currently is, that is via use of the leoSettings.

​I agree.  That's why putting @button nodes in workbook.leo is a good idea.

​Edward​

Edward K. Ream

unread,
Nov 27, 2017, 7:14:43 AM11/27/17
to leo-editor
On Mon, Nov 27, 2017 at 6:12 AM, Edward K. Ream <edre...@gmail.com> wrote:
On Sun, Nov 26, 2017 at 12:56 PM, <rvn...@tesco.net> wrote:

 

5) a setup.py is the standard way of installing a python program and used by distribution-specific install-scripts that enable keeping track of what is installed. Pip makes this more obscure so that it is important that a setup.py file is present and up-to-date

​Leo is an app, not a python package.  I would like to see setup.py disappear completely.  Perhaps Matt has already done that as a result ​of his work creating a linux package.

​Well, I haven't kept track of what Matt actually did, which is to upgrade setup.py.  I haven't tested the new setup.py.  Perhaps it works as you expect.

Edward

Offray Vladimir Luna Cárdenas

unread,
Nov 27, 2017, 8:29:23 AM11/27/17
to leo-e...@googlegroups.com

Hi,

Anaconda can be overkill for installing Leo, but Miniconda is no (only 60 mb). It's the preferred way those days to give installing support in the Python (scientific) ecosystem, and making Leo conda installable is important for the same reasons that Jupyter, Numpy and all the other packages in that ecosystem have chosen coda: to make installation easier and more modular and let you experiment without system specific installs that preclude parallel versions and sandboxing and are distro/OS specific.

So a good install procedure for Leo could be:

- Install *miniconda* (60 mb).

- conda install leo.

A template of how this is done in Jupyter is here:

https://cs205uiuc.github.io/guidebook/resources/python-miniconda.html

Cheers,

Offray

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.

Chris George

unread,
Nov 27, 2017, 9:54:05 AM11/27/17
to leo-e...@googlegroups.com
I am not a programmer.

I can't emphasize that enough.

I am a writer who has been using Leo for the past decade. I am also a Linux user. Over the years I have used Debian, Ubuntu, Arch, Mandrake, Mint and now Chakra. I have gone through several desktop computers and a number of laptops.

Along the way I have learned a few things about Linux distributions, python and Leo. As bandwidth and hard drive space are far cheaper than my time, I settled on using Anaconda to keep me out of the morass of spending hours troubleshooting how different distributions deal with python. It may have prevented me from learning more about python and achieving the most precise and streamlined python install possible for my needs, but it has certainly saved me a LOT of time that I have been able to spend writing.

Installing Anaconda just works.

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscribe@googlegroups.com.

To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscribe@googlegroups.com.

Offray Vladimir Luna Cárdenas

unread,
Nov 27, 2017, 10:09:56 AM11/27/17
to leo-e...@googlegroups.com

I not a programmer either. Installing Miniconda is the same effort as installing Anaconda, gives you the same core functionality (with less overheat and preinstalled packages, mostly for science) and it saves bandwidth, space *and* time, which is handy in places in the Global South, where bandwidth is not cheap and/or reliable.

So, installing Miniconda just works also and keeps things light so users can focus in their tasks with Leo, instead of fighting dependencies or distro/OS specific idiosyncrasies.

Cheers,

Offray

To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.

brobr

unread,
Nov 27, 2017, 10:59:41 AM11/27/17
to leo-editor
​Leo is an app, not a python package. 

Well I do not think this is a relevant difference; all pip-installs end in python/site-packages. And most setup.py installs as well.

Leo is quite big, > 30 Mb; for comparison, numpy is 15 Mb, pylint ~2.3 Mb, pyenchant ~0.4  Mb and all sit in the same directory in the python-tree; miniconda is also not 'mini' being between 30-50 Mb. Although this might be the preferred way for some (linux) users to get all dependencies sorted, with pip this could be done automatically whilst for others, who would like the python/distribution method using a setup.py, dependencies are obviopusly less of a problem.

Let the users decide how to install/use leo, as long as the methods that can be used are clear and at least conform general expectations for a python app/package/module

Cheers,

Rob

Terry Brown

unread,
Nov 27, 2017, 11:24:48 AM11/27/17
to leo-e...@googlegroups.com
On Mon, 27 Nov 2017 06:54:03 -0800
Chris George <techn...@gmail.com> wrote:

> Installing Anaconda just works.

In the list of installation options, we could maybe characterize them
in a few words, e.g. for Anaconda, "larger download, but this is the
option that 'just works'".

Cheers -Terry

Edward K. Ream

unread,
Nov 27, 2017, 11:37:32 AM11/27/17
to leo-editor
On Mon, Nov 27, 2017 at 9:59 AM, brobr <rvn...@tesco.net> wrote:
​Leo is an app, not a python package. 

Well I do not think this is a relevant difference; all pip-installs end in python/site-packages. And most setup.py installs as well.

​Yes.  I was mistaken.

Edward

Offray Vladimir Luna Cárdenas

unread,
Nov 27, 2017, 12:24:35 PM11/27/17
to leo-e...@googlegroups.com
So, the characterization for Miniconda would be: 'Small download (60 mb)
and is the option that "just works")'.

Cheers,

Offray

Terry Brown

unread,
Nov 27, 2017, 12:42:58 PM11/27/17
to leo-e...@googlegroups.com
On Mon, 27 Nov 2017 12:24:31 -0500
Offray Vladimir Luna Cárdenas <off...@riseup.net> wrote:

:-) maybe. To be honest I've only used conda (the package manager) from
the command line, so I really don't know what installing Leo's
dependencies looks like to a non-command line user. I think Anaconda
and miniconda might differ in that respect, I know Anaconda installs
some sort of dashboard / point and click package management front end
that I think is absent from miniconda.

Definitions:

conda: a package manager
miniconda: a minimal Python install using conda. Intended use is
deployment of isolated Python environments with different sets of
dependencies:
https://conda.io/docs/user-guide/tasks/manage-environments.html
Anaconda: a large ecosystem of scientific analysis software (including
Jupyter notebooks and the Spyder Python IDE) deployed using conda.

From a non-command line perspective I wonder if Anaconda really just
channels people into Jupyter/Spyder - probably just a matter of time
before we spend a week trying to understand a bug before we realize the
user has confused Spyder and Leo :-)

But I guess we can label miniconda "just works" if we link to clear
step by step instructions for using it on Leo's web page.

Cheers -Terry

Terry Brown

unread,
Nov 27, 2017, 12:52:29 PM11/27/17
to leo-e...@googlegroups.com
To clarify my concern about Anaconda installs directing people away
from Leo, here's what the Anaconda navigator looks like:

https://docs.anaconda.com/_images/navigator-home-1-6.png

If you're trying to install Leo and see that Spyder button - meh, close
enough, what do I care what it's called?

Cheers -Terry

Offray Vladimir Luna Cárdenas

unread,
Nov 27, 2017, 1:05:53 PM11/27/17
to leo-e...@googlegroups.com
Hi,

I could try to install Leo on Linux via miniconda. There is any channel
I need to add for that? My actual installation doesn't find Leo (see
result below)

========

conda install leo
Fetching package metadata .............

PackageNotFoundError: Packages missing in current channels:
           
  - leo

We have searched for the packages in the following channels:
           
  - https://conda.anaconda.org/r/linux-64
  - https://conda.anaconda.org/r/noarch
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.continuum.io/pkgs/free/linux-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/linux-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/linux-64
  - https://repo.continuum.io/pkgs/pro/noarch

========

Cheers,

Offray

Terry Brown

unread,
Nov 27, 2017, 1:13:57 PM11/27/17
to leo-e...@googlegroups.com
On Mon, 27 Nov 2017 13:05:48 -0500
Offray Vladimir Luna Cárdenas <off...@riseup.net> wrote:

> Hi,
>
> I could try to install Leo on Linux via miniconda. There is any
> channel I need to add for that? My actual installation doesn't find
> Leo (see result below)

Ok, kind of funny - there's no support for installing Leo with conda
(in either Anaconda or miniconda environments). The suggestion is just
that you install Leo's dependencies with (Ana)conda. Having done that,
the easiest way to install Leo would be pip (which works in conda
environments).

Also, despite using Python 3, my conda environment is failing to find a
pyenchant package in Windows 10 64 bit. Not sure if I'm missing it or
what.

Cheers -Terry
Reply all
Reply to author
Forward
0 new messages