Is it safe to run different instances of Leo on the same machine?

47 views
Skip to first unread message

Viktor Ransmayr

unread,
Apr 25, 2020, 8:50:03 AM4/25/20
to leo-editor
Hello Edward & Community,

I'm trying to understand the various installation options mentioned in Leo's documentation better.

As you know from my previous post, I almost always rely on the latest released stable version of Leo installed via pip from PyPI into a dedicated PyVE.

Today I tried to install a new separate Leo-devel instance using the method 'Installation from source (all platforms)' [1] into a new PyVE.

I succeeded to install this new instance w/o problems - and - I was able to start this new instance for the first time as well.

Please also note that before I started this new instance, I did explicitly close the instance of Leo-stable running at that time!

The reason why I'm asking this question is that in the logs of the new instance I receive the following messages:

###

(Leo-devel) [user@fedora-leo-study-vm Leo-devel]$ leo

setting leoID from os.getenv('USER'): 'user'
Leo 6.3-devel
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/setup.py
not found: /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo_to_html.xsl
not found: /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/run_travis_unit_tests.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/run_pytest_tests.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/flake8-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/pyflakes-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/pylint-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/test/leo-bridge-test.py

###

This message clearly show that the new instance, startup details below

###

Leo Log Window
Leo 6.3-devel
Python 3.7.6, PyQt version 5.14.2
linux
setting leoID from os.getenv('USER'): 'user'
current dir: /home/user/PyVE/Src/Leo-devel
load dir: /home/user/PyVE/Src/Leo-devel/leo-editor-devel/leo/core
global config dir: /home/user/PyVE/Src/Leo-devel/leo-editor-devel/leo/config
home dir: /home/user
reading settings in /home/user/PyVE/Src/Leo-devel/leo-editor-devel/leo/config/leoSettings.leo
reading settings in /home/user/.leo/myLeoSettings.leo
reading settings in /home/user/Documents/SL2020.leo
read outline in 0.15 seconds
reading settings in /home/user/.leo/myLeoSettings.leo

###

try to use data from the other, currently closed, instance of Leo-stable (6.2.1)

Asking my initial question once more, now hopefully even a bit more precise:

Is it safe to sequentially run two or more instances of different Leo versions on the same machine?

With kind regards,

Viktor


Thomas Passin

unread,
Apr 25, 2020, 10:02:33 AM4/25/20
to leo-editor
I've done it from time to time, sometimes by accident.  Each instance of Leo will use the same configuration files, as your logs show.  This means that the last instance to exit will be the one that may change these files, like the list of recent files.

I have also noticed that if I have the same outline open in two instances at the same time and  make a change to the outline in one, the other instance does not know that a change has been made.  It seems to me that it would not be hard to have Leo notice, since it can already notice if external files (like @file trees) have been changed outside Leo.  This would seem to be a worthwhile change to make.

On Saturday, April 25, 2020 at 8:50:03 AM UTC-4, Viktor Ransmayr wrote:
Hello Edward & Community,

[snip]

Asking my initial question once more, now hopefully even a bit more precise:

Is it safe to sequentially run two or more instances of different Leo versions on the same machine?



Viktor Ransmayr

unread,
Apr 25, 2020, 10:10:48 AM4/25/20
to leo-editor
Hello Edward & Community,
For what it's worth: I just noticed that I receive the same error messages also, when I restart the instance of Leo-stable ...

###

(Leo-stable) [user@fedora-leo-study-vm Leo-stable]$
setting leoID from os.getenv('USER'): 'user'
Leo 6.2.1 final

can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/setup.py
not found: /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo_to_html.xsl
not found: /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/run_travis_unit_tests.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/run_pytest_tests.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/flake8-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/pyflakes-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/pylint-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/test/leo-bridge-test.py

###

and in the third & last PYVE that I created in the mean time, where I tried out the "Installing Leo with git" method [2]

###

[user@fedora-leo-study-vm ~]$ cd PyVE/Repo/Leo-Repo/
[user@fedora-leo-study-vm Leo-Repo]$ source bin/activate
(Leo-Repo) [user@fedora-leo-study-vm Leo-Repo]$ leo


setting leoID from os.getenv('USER'): 'user'
Leo 6.2.1 final, master branch, build 49c5e4fa3c
2020-03-30 08:39:10 -0500

can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/setup.py
not found: /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo_to_html.xsl
not found: /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/run_travis_unit_tests.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/run_pytest_tests.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/flake8-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/pyflakes-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/pylint-leo.py
can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo/test/leo-bridge-test.py

###

Looking forward to your answer(s).

With kind regards,

Viktor

---


Matt Wilkie

unread,
Apr 25, 2020, 2:16:06 PM4/25/20
to leo-editor
Hi Viktor,

can not open /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/setup.py
not found: /home/user/PyVE/PyPI/Leo-stable/lib64/python3.7/site-packages/leo_to_html.xsl
[...]

Pypi installed Leo doesn't have the files which are in the root directory of the source code repository. -- setup.py, Readme.md, etc. This is something we can't do anything about (without changing the whole code base). However these files in the root are required to run and use Leo.
Source code installed Leo has everything, at the cost of a few more command lines to write and execute:
I suspect the reason you got the messages is because your previous session of Leo had those files open and it tried to re-open them in the new version. Leo is looking in "site-packages" because the path to those files in the session db is relative to Leo's home library path. The new Leo library path is in PYTHONHOME/site-packages and the old library path was somewhere else, perhaps ~/PyVE/Src/Leo-devel/leo-editor-devel/.

As for is it safe to switch back and forth between Leo versions?  I think it's safe-ish but not fool proof. If the things you are working on don't have anything to do with Leo, ie. you're not hacking on Leo's sources, you should be fine. (With caveats if you make use of features that may or not be present in the other version).

To make it safer use a different ~/.leo for each one by changing HOME environment variable before starting Leo.

-matt

Viktor Ransmayr

unread,
Apr 25, 2020, 2:50:25 PM4/25/20
to leo-e...@googlegroups.com
Hello Matt,

This is a first response from my side, in order to provide you an **initial** feedback!

In other words, I might change my mind, if I wake up tomorrow morning - and - will review this thread / topic again ;-)

This is counter intuitive to my understanding of why Python has introduced PyVE's!

At the moment my gut feeling is that Leo should change here ...

With kind regards,

Viktor

Thomas Passin

unread,
Apr 25, 2020, 7:31:58 PM4/25/20
to leo-e...@googlegroups.com

On Saturday, April 25, 2020 at 2:50:25 PM UTC-4, Viktor Ransmayr wrote:
Hello Matt,

This is a first response from my side, in order to provide you an **initial** feedback!

In other words, I might change my mind, if I wake up tomorrow morning - and - will review this thread / topic again ;-)

[snip]
This is counter intuitive to my understanding of why Python has introduced PyVE's!

At the moment my gut feeling is that Leo should change here ...

My understanding of the value of using Python virtual environments is this-

- You can run Python using a different set of libraries or different version of the libraries, without needing to have these versions override the ones in your main installation.
- You want to test, try out, or develop a libraries or module and you want to try to make sure you know the minimal set of libraries (and perhaps their version) needed to run it.

The usual way to install these other libraries is using pip, though there are other ways. For pip-installable packages, you can find out which versions are available by adding "==" to the install command; e.g.,

python -m pip install leo==

ERROR: Could not find a version that satisfies the requirement leo== (from versions: 4.11-final, 5.0-final, 5.7.dev406, 5.7b2.dev27, 5.7, 5.7.2, 5.7.3, 5.8b2, 5.8, 5.8.1b1.dev182, 5.8.1b1.dev183, 5.9b1, 5.9b2, 5.9, 6.0b1, 6.0, 6.1.dev0, 6.1b1.dev0, 6.1b1, 6.1, 6.2.dev0, 6.2b1, 6.2, 6.2.1)

The "==" usually is used to specify the exact version you want.  So if I wanted to compare Leo 6.2.1 (my standard installed version) against Leo 6.1, I could set up a new virtual environment, and install Leo in it using pip install leo==6.1. (Note that just because a version is listed here, there is no guarantee that the supporting libraries will be available.  For example, I wouldn't be able to install 4.11-final because it requires the PyQt4 libraries, and they aren't available any more; that version is just too old).

Of course, this won't work if you want to try versions that are not available to pip. No one is likely to make a pip-installable install package for a version under active development, one that changes frequently.

None of this is within Leo's control, so it's hard for me to see what the Leo developers could do differently.

Matt Wilkie

unread,
Apr 25, 2020, 9:03:41 PM4/25/20
to leo-editor
To make it safer use a different ~/.leo for each one by changing HOME environment variable before starting Leo.

This is counter intuitive to my understanding of why Python has introduced PyVE's!

At the moment my gut feeling is that Leo should change here ...

It becomes a question of how isloated and unique one wishes to become. The leakage you described is from settings and files in your HOME directory being available to all PyVEs. Extend virtualness far enough, so there's zero chance of one environment seeping into another, you're better using different computer login accounts, or even distinct OS and hardware.

I can envisage configuring Leo so that if {current-Leo-install-path} doesn't match {HOME/.leo-recorded-install-path}: create a new {HOME/.leo-install-path}, but then you'd lose all your settings and be back to factory defaults. From there it might be desirable to have a Leo user settings migration tool, but how to choose what to keep and what to leave behind? Every person will have their own and different answers.

Getting back to the warning messages you saw: they mean the files you had open in previous session are not available now. There's nothing else Leo could possibly do other than say "hey, I can't find these". Well, actually it could just never save and reload sessions; maybe there's even a setting for that already.

-matt

-matt


Reply all
Reply to author
Forward
0 new messages