It's hard for me to know what you want to convey with these long 
transcripts.  It would be better if they were edited, or at least if you 
would point out results that you don't like or don't understand.  But I can 
see a few things, I think:

1. Installing Leo's dependencies using pip -r requirements.txt does not 
install Leo itself.  It does not create those scripts in the venv's bin 
directory.  It only installs the modules and packages that Leo needs.  You 
have to install Leo using pip for that (while the venv is active).  For 
example, in my "leo" venv, which has Leo's dependencies but into which I 
haven't installed leo using pip, there is no *leo* script:

(leo) tom@thomas-xubuntu-VirtualBox:~/venv$ ls leo/bin/ |grep "leo"
# there was no result

2. Using python3 -m leo.core.runLeo, when you have cd'ed to your github's 
leo-editor directory, finds Leo's files because Python starts looking for 
files starting at the current directory.  If you export the PYTHONPATH 
shell variable, then Python will start by looking there.  That's why I 
recommend using a script that sets the variable.  Then you don't have to 
remember to cd to the right directory first.

3. Even after you have activated your venv, the shell will not find its 
*leo* script because there isn't one. It won't be there unless you 
pip-install Leo while the venv is activated. The results from running 
*which* show that.  You could also use *whereis*, and get the same result.  
Even if you installed Leo in the venv and started Leo using the venv's *leo* 
script, 
Leo would be using the Leo code in the venv, not the code in your github 
repo.

4. Your transcript shows that Leo started when you had cd'ed to its repo 
directory.  But I can only see Leo's startup output to the console. That 
output looks normal.  But it doesn't tell me if the Leo window actually 
opened and worked.  Did it?

HTH


On Wednesday, May 15, 2024 at 6:22:34 AM UTC-4 viktor....@gmail.com wrote:

Hello Thomas,

Thanks a lot for all the feedback & input you provided ! - I will read them 
one by one ...

tbp1...@gmail.com schrieb am Dienstag, 14. Mai 2024 um 20:05:10 UTC+2:

It can be hard to be sure what the Python search path is.  Here is what 
shows up for my system when I have activated my "Leo" VE.  This VE (on 
Windows) is contained in the directory  C:\Tom\venvs\leo. Note that on 
Windows you don't have to source the script.


Please bear with me a bit longer, as I'm sometimes stubborn ;-)

I'd like to understand, why the case of 'Leo from GitHub in a PyVE' is no 
longer working ?  - It has worked on Linux (Debian & Fedora) up until Leo 
version 6.7.7 (maybe evern 6.7.8) !

I'd like to do that, before creating an **additional personal** script, 
since I still believe it should be part of Leo's GitHub repository ...

I did use your advice to check  Python's search path, etc. - Here are the 
results for the three relevant cases in my Debian 12 VM:

* Check out Python's search path with Leo outside of any PyVE - See 
"Log-001".
* Check out search path in Leo's PyVE from PyPI - See "Log-002".
* Check out search path in Leo's PyVE from GitHub - See "Log-003".

Note 1: The first variation is necessary for me to address Leo-Integ issue 
# 299 <https://github.com/boltex/leointeg/issues/299>.

Note 2: The answer to my question has to do with the fact that no 'leo' 
module is found in '/home/user/PyVE/GitHub/Leo/bin'  - See "Log-003" ...

With kind regards,

Viktor

### Log-001

    user@debian-leo-study-vm:~$ 
    user@debian-leo-study-vm:~$ python3 -c "import 
sys;print('\n'.join(sys.path))"

    /usr/lib/python311.zip
    /usr/lib/python3.11
    /usr/lib/python3.11/lib-dynload
    /home/user/.local/lib/python3.11/site-packages
    /usr/lib/python3/dist-packages
    /usr/lib/python3.11/dist-packages
    user@debian-leo-study-vm:~$ 
    user@debian-leo-study-vm:~$ 
    user@debian-leo-study-vm:~$ python3 -m leo.core.runLeo --version
    Leo 6.7.8
    Python 3.11.2
    linux

    user@debian-leo-study-vm:~$ which leo
    /home/user/.local/bin/leo
    user@debian-leo-study-vm:~$ 
    user@debian-leo-study-vm:~$ echo $PATH
    
/home/user/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    user@debian-leo-study-vm:~$ 

### Log-002

    user@debian-leo-study-vm:~$ cd PyVE/PyPI/Leo/
    user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ source bin/activate
    (Leo) user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ python3 -c "import 
sys;print('\n'.join(sys.path))"

    /usr/lib/python311.zip
    /usr/lib/python3.11
    /usr/lib/python3.11/lib-dynload
    /home/user/PyVE/PyPI/Leo/lib/python3.11/site-packages
    (Leo) user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ python3 -m 
leo.core.runLeo --version
    Leo 6.7.8
    Python 3.11.2
    linux

    (Leo) user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ which leo
    /home/user/PyVE/PyPI/Leo/bin/leo
    (Leo) user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ echo $PATH
    
/home/user/PyVE/PyPI/Leo/bin:/home/user/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    (Leo) user@debian-leo-study-vm:~/PyVE/PyPI/Leo$ 

### Log-003

    user@debian-leo-study-vm:~$ 
    user@debian-leo-study-vm:~$ cd PyVE/GitHub/Leo
    user@debian-leo-study-vm:~/PyVE/GitHub/Leo$ source bin/activate
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo$ python3 -c "import 
sys;print('\n'.join(sys.path))"

    /usr/lib/python311.zip
    /usr/lib/python3.11
    /usr/lib/python3.11/lib-dynload
    /home/user/PyVE/GitHub/Leo/lib/python3.11/site-packages

    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo$ python3 -m 
leo.core.runLeo --version
    /home/user/PyVE/GitHub/Leo/bin/python3: Error while finding module 
specification for 'leo.core.runLeo' (ModuleNotFoundError: No module named 
'leo')
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo$ which leo
    /home/user/.local/bin/leo

    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo$ cd leo-editor/
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$ python3 -m 
leo.core.runLeo --version
    Leo 6.7.9-devel, devel branch, build fb85027eac
    2024-05-13 16:10:23 -0500
    Python 3.11.2
    linux
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$ which leo
    /home/user/.local/bin/leo
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$ 
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$ echo $PATH
    
/home/user/PyVE/GitHub/Leo/bin:/home/user/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$ 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1e7afd3d-c00a-4206-ac7b-6d70bc99fda8n%40googlegroups.com.

Reply via email to