On Wed, 18 Dec 2019 08:51:04 -0800 (PST) Matt Wilkie <[email protected]> wrote:
> I think I made the code more complicated than needed. `Import leo` > etc. is only needed if the file will be called outside Leo, e.g. > `python hello-world.py`. Yes. My need is to say python3 hello-world.py . I want to produce software others can use without Leo. > This should work in a node by itself with > ctrl-b: > > g.es_print(g.computeHomeDir()) Yes. When I ctrl+b, I indeed get the correct answer in the upper right panel. > > > Traceback (most recent call last): > > File "helloclean.py", line 2, in <module> > > import leo.core.leoGlobals as g > > ModuleNotFoundError: No module named 'leo' > > > > pip install --editable /home/slitt/build/leo-editor-master I'd *really* prefer not to do that. I'm not a fan of pip, preferring to get all my packages from my distro, Void Linux. I would jump through a lot of hoops to avoid pip. > > Will add `leo.egg-link` in `PYTHONHOME/Lib/site-packages` which > enables `import leo` to work. The egg-link file contains the path to > the code directory, so editing sys.path shouldn't be needed. I searched but couldn't find an example copy of leo.egg-link, and as I mentioned, prefer not to use pip. I'm willing to edit sys.path. Do you know how I can do that? Thanks for your help, Matt. SteveT Steve Litt December 2019 featured book: Rapid Learning for the 21st Century http://www.troubleshooters.com/rl21 -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/20191219081110.42ba4907%40mydesk.domain.cxm.
