-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Problem starting the leo-bridge server automatically with anaconda/miniconda on windows #10
Comments
Ah, when I manually run |
First off Thanks for being the first collaborator in this issues reporting section! |
Forgot to mention that the welcome screen will only open automatically on the first activation and on major version updates. But of course you can open it anytime with the command palette: ctrl+shift+P , and start typing 'welcome' or 'Leo settings' |
So I've re-read your console output more carefully and it seems that the server auto-start routine tried to start it and wrote in the log output: "Launch with default command : py -3 c:\Programs\leointeg/leobridgeserver.py". But you seem to be able to start a python script on your system with the "python" command. For now this extension just default to start a python script on windows with "py -3". (as opposed to "python" on other OSes) I should add more features to the automatic server startup service in order to have it detect the optimal way to start a python script on a given system. To counter this lack of proper detection, the workaround I have put in place is a configuration option called "Python Command" near the bottom of the setting for leoInteg. (open leo settings via the command palette: Ctrl+Shift+P and start typing "leo settings") where you can specify a particular string command to start the leoBridge. (in your case "python") Tell me if this makes sense. If it does, I'll close this and create another issue about "detecting optimal way to start python script on given system/os" because obviously my detection procedure is way too simplistic. Thanks! :) Edit: typos |
I think a configuration option is fine, but I couldn't get it to work so far. This may be related to my using Anaconda, where there recommended way to use it is to activate the environment using Anaconda's activate.bat. This doesn't seem to work from VSCode. I also have Anaconda's With
With
|
Thank you @ar-jan , I've noted this issue as it being related to anaconda/miniconda environments, and will address this aspect of automatic leoBridge server startup. In the meantime I guess someone would have to simply start an instance of the leoBridgeServer.py manually. I'll update the 'how to try this developpment version' part of the documentation to help other people who'd like to try and test out this extension. |
My recipe for getting up and running with conda on a newish Win10 machine is here:https://groups.google.com/d/msg/leo-editor/lNoYr0rUVPw/UiKDsimWBAAJ For me also the automatic start does not work, but it does from a vscode terminal. I tried putting Debug Console output with the setting blank:
and with set to
and set to
This is what the terminal output is when started from the original vscode window. Note the only part which was me is
|
It's late & im tired so this may be a silly suggestion, but what about chaining commands? i.e. conda activate vscode-leo & python or conda activate vscode-leo && python is it & or && to chain commands? ...i never remember of course that's just a suggestion that came to mind... - i'll try some stuff and post more potent solutions here after a good nights sleep :) oh! and many thanks for reporting ! it's things like this that make the project more easily installable to others until a real extension is released on the vscode market! :) |
So, I just updated to the latest version on master (2020-07-04 |
Observation: I currently have "Start Server" unchecked, but when I F5 the leobridgeserver.py command is run. |
There are 3 different ways to start the leobridge server in leoInteg. It seems to me you're mixing them up, maybe... not sure. Before pressing F5, unfold the top dropdown to choose what to run and debug : 'run extension' only is the equivalent of running the extension as it's intended to when it's finally compiled and released. Using "Python: leoBridge Server" or "Server and Extension" tells vscode you want it to start to run and debug the leobridge server as if it's the project you're working on, if that makes sense... so obviously you'll see a server start, but it's not leoInteg who's starting it, it's vscode debug panel. Like I said on leo's forums, this is just quick 'thinking out loud' reply and I will soon cleanup those processes, and re-write more detailled documentation about this. (and I'll make sure to keep you updated) Oh! and most importantly: Thanks again for reporting all those tryouts man! Very much appreciated ! Félix |
Ah, looks like it. I'd just been running F5 without looking at the setting, which was set to "Server and Extension" for me. Anyway the big thing is that for some reason starting the bridge now works from leointeg, so I don't have to start it manually from cli anymore :). |
I think it's the same for Windows CMD and 'nix Bash. In powershell I've read that it's different. My go-to place for things like this is SS64.com (https://ss64.com/nt/syntax-redirection.html). I haven't had time to dig through the new stuff yet. It'll be a few days. |
Upon trying this out a bit more, my previous message was premature/incomplete. Only the following combination seems to work well:
I had previously experimented extensively with chaining the |
something not right in what you're describing... Leointeg's Python Command configuration set to python and Running the extension with the Server and Extension option are mutually exclusive: I have not explained those concepts clearly - and as I wanted to give more options for tester than less, it seems people are mix and matching those methods of starting the server in erroneous ways. So to clarify: if you're running the extension with the "Server and Extension", then, the python command could be set to 'potato' it wouldn't matter because it's not used then. That would be using the debug profile in the .vscode/launch.json file. which I encourage you to open and see for youself what those 3 debugging profiles are,. those will not exist at all when the extension is compiled and distributed as a real extension. So this is important to distinguish: to simulate a real, finished extension, select 'run extension' only in the run/debug menu. this will force you to either : If you instead select "server AND extension" in the run/debug panel, then, vscode will run and debug the server by itself, as if vscode itself was considering the server program as it's main project. and will use whichever python debug setting vscode's debugger is set to. Not the leoInteg options! So...Either configure a python command line setting in leo Integs settings, and use the 'run extension' only in the run/debugger dropdown. OR , don't start server automatically, and use the "start both server and extension" in the run/debuger dropdown instead. (ok to connect automatically though, doesnt matter how the server was started to connect to it automatically) Again, sorry English is not my native language. (i guess i should capture myself as a screencast while explaining this) Félix |
Ah yes of course, that's what you were also saying on the list. So scratch the |
I wonder if this could be retested somehow? |
I'm currently not using Windows and don't have an installation for testing. Interestingly I have other problems now on Linux, mainly with the Jupyter extension failing to load, but that seems related to the Python interpeter configuration. Hoping to try out leointeg again soon. |
@ar-jan Hi again! :) in leo-editor/leo-editor#2119, you state it somewhat works now, So I was wondering if this issue about starting the server automatically with anaconda/miniconda is still relevant...? Did the new 'Server options' have helped working around this problem? ...or are you not using anaconda/miniconda in your recent tests? Anyways thanks again for your good suggestions and testing! Appreciated! Félix |
I think things have changed enough that this issue is no longer applicable and can be closed - or needs to be opened as new. I am successfully using Leo Integ via a pipx venv with a setup very similar to my conda one above. Key to the solution was the new Path settings via #292 and LeoInteg v1.0.15. For the record, here are the working paths for my system:
(Note: use |
Hi, it looks like you've been making great and steady progress over the last several months. Awesome! I just tried out the dev branch and I'v run into a problem loading the extension. I've installed all dependencies etc as described. Actually the first time I ran F5 to run the extension a welcome screen with Leo icon did appear, but I'd already clicked a VSCode message about window loading taking longer than 10 seconds, and trying a reload. Now I don't see the Leo welcome anymore.
When I click the "Connect to Leo Bridge server" icon in the Leo tab, I get
Leo Bridge Connection Failed
.The terminal in the original window says this:
And the debug console says:
I do have
websockets
installed in my default Python environment (which is an Anaconda env, Python 3.7.3). Any way to check if leointeg is using the correct Python environment? Alsonpm install
from within VSCode terminal says all packages are installed.echo %PYTHONPATH%
givesC:\Programs\Leo
(correct). I'm on Windows 10. Leo is at version 6.0-final.Any ideas to debug this further?
The text was updated successfully, but these errors were encountered: