Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - Cannot start server: Cannot find server script #291

Closed
maphew opened this issue Sep 29, 2023 · 4 comments
Closed

Error - Cannot start server: Cannot find server script #291

maphew opened this issue Sep 29, 2023 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@maphew
Copy link

maphew commented Sep 29, 2023

This is likely a local problem, but I'll open an issue here and update as I figure it out so the record helps someone else down the road.

Background: I use vscode across several machines and have sync extensions turned on. I installed LeoInteg on one of them a long time ago but have not used in well over a year.

Today on my home Win11 Pro desktop I upgraded vscode, and installed Leo with the recipe:

  1. Install, from CMD prompt:
winget upgrade vscode
git clone --depth=500 --no-single-branch https://github.com/leo-editor/leo-editor
cd leo-editor
pipx install .
pipx inject leo websockets
  1. Run Leo interactively once to create .leo profile and verify is working properly. Close.

  2. Run vscode, open Leo Integration Settings, point to Leo-Editor Path (C:\Users\Matt\.local\bin)

  3. Ctrl-Shift-L to open Leo Integ side panel >> hit [start server] button >> yields following pop error:

"Error - Cannot start server: Cannot find server script

@boltex
Copy link
Owner

boltex commented Sep 29, 2023

Hi Matt! 😁

From the looks of it, I would suspect that the path you deem as being the 'Leo Editor' installation path, C:\Users\Matt\.local\bin, is just the folder where the launchable/executable shortcuts to start Leo resides, and not the real Leo installation folder (where it's code resides.) The inside of that folder would usually look something like this:
image

Perhaps this screenshot will help you find the proper folder: (click on it to enlarge) In the screenshot below, I have LeoInteg's log pane open at the bottom, and we can see the actual path LeoInteg thinks the actual 'leoserver.py' should reside, given the Leo Editor's base installation path you have provided. (It just adds /leo/core/leoserver.py to the path you've given )
image

So after Leo is installed on your computer, try to find a file called leoserver.py on your hard-disk. Once found, go 'up' by two folders, that would be your Leo installation folder. (In the screenshot below, I've found mine in C:\prog\leo-editor\leo\core so my Leo Installation folder is just : C:\prog\leo-editor
image

Hope this helps!!
(Edit: typos)

@boltex boltex self-assigned this Sep 29, 2023
@boltex boltex added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 29, 2023
@maphew
Copy link
Author

maphew commented Oct 6, 2023

Ah, ok. In this case since Leo is known to run the easiest method to locate the path was to start Leo and use the path given for leo-editor: in the log window. Thanks Felix!

Leo Log Window
Leo 6.7.5-devel
Python 3.11.6, PyQt version 5.15.2
Windows 10 AMD64 (build 10.0.22621) SP0
home: C:\Users\Matt
-----> leo-editor: C:\Users\Matt.local\pipx\venvs\leo\Lib\site-packages <--------
load: C:\Users\Matt.local\pipx\venvs\leo\Lib\site-packages\leo\core
config: C:\Users\Matt.local\pipx\venvs\leo\Lib\site-packages\leo\config
reading settings in C:\Users\Matt.local\pipx\venvs\leo\Lib\site-packages\leo\config\leoSettings.leo
Invalid language code for Enchant 'en-US'
Using "en_US" instead
Use @string enchant_language to specify your language

I tried to build a quick script which could do this programmatically, but I've been away from Leo for too long and my memory cells are rusty. At any rate, here's the proto-recipe:

C:\> echo print(g.os_path_finalize_join(g.computeLeoDir(), '..')) > report-leo-path-for-leointeg.leox
C:\> leo-console --script=report-leo-path-for-leointeg.leox 

Result:

** (python3.11.exe:4464): WARNING **: 11:23:23.396: Error loading plugin: 'C:\Users\Matt.local\pipx\venvs\leo\Lib\site-packages\enchant\data\mingw64/lib/enchant-2\enchant_hunspell.dll': The specified module could not be found.

Leo 6.7.5-devel
Python 3.11.6, LeoGui: dummy version
Windows 10 AMD64 (build 10.0.22621) SP0
C:/Users/Matt/.local/pipx/venvs/leo/Lib/site-packages

Exercise for reader to grab only the last line from the output. Or change print(...) so that it writes that single line to a file.

@maphew
Copy link
Author

maphew commented Oct 6, 2023

My celebration was premature. Now there's a new error when attempting to connect to the server:

Leo Server Connection Failed: Websocket closed, code: 1006

@maphew
Copy link
Author

maphew commented Oct 6, 2023

This seems to be related to difficulties properly configuring to run from a virtual environment, #10, which I see I participated in a couple years ago but ran out of steam tracing to the source. Eep! I'll close this one, since the initial error is remedied, and follow up there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants