Additional note: Refreshenv allows carrying out all commands in a single 
session. Without this opening a new CMD shell several times to catch 
changes each of the installs make is necessary.

On Sunday, October 15, 2023 at 9:33:24 p.m. UTC-7 Matt Wilkie wrote:

> Thanks for the feedback!
>
> My mistake. Sudo comes with Gsudo, and I forgot I had done that. (`winget 
> install gsudo`).
>
> Installing Leo from Pypi on Py v3.12 will not work until next Leo release 
> (see https://github.com/leo-editor/leo-editor/pull/3612 and 
> https://github.com/leo-editor/leo-editor/issues/3615) 
> So that's also my mistake, since I specified 3.12 at the top. 
>
> -matt
>
>
> On Sunday, October 15, 2023 at 9:27:08 p.m. UTC-7 tbp1...@gmail.com wrote:
>
>> sudo setx /M PIPX_BIN_DIR C:\bin
>>
>> Where did we get *sudo* from? Does it come with *winget*?  
>> Did this work for Leo with Python 3.12?  Because something seems to be 
>> mis-configured with what's on PyPi right now, and it doesn't work.
>>
>> On Monday, October 16, 2023 at 12:17:14 AM UTC-4 map...@gmail.com wrote:
>>
>>> Here's my recipe. Building qt and Anaconda are not needed.
>>>
>>> Installing Leo from scratch on a new machine, following my preferences, 
>>> some adjustment may be needed to match yours.
>>>
>>>  
>>> Overview 
>>>
>>> All but step 1 can be done from the command line, below.
>>>
>>>  
>>>
>>>    1. Install the winget 
>>>    <https://learn.microsoft.com/en-us/windows/package-manager/winget/> 
>>>    command line package manager by installing App Installer 
>>>    <https://apps.microsoft.com/detail/9NBLGGH4NNS1> from Microsoft 
>>>    Store.
>>>    2. Download refreshenv.cmd 
>>>    
>>> <https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd>
>>>  
>>>    in place in PATH (optional).
>>>    3. Install python launcher <https://peps.python.org/pep-0397/>, a 
>>>    shortcut to all the python installs on a system.
>>>    4. Install python <https://www.python.org/downloads/> from Python 
>>>    Software Foundation.
>>>    5. Install pipx <https://pypa.github.io/pipx/>, for managing python 
>>>    programs as applications.
>>>    6. Fetch Leo <https://leo-editor.github.io/leo-editor/> (choose from 
>>>    pypi.org or source code)
>>>    7. Install Leo
>>>    8. Register Leo with Windows
>>>
>>>  
>>>
>>>  
>>>
>>> From a CMD shell (
>>> https://gist.github.com/maphew/fe6e5c2ccbf48fc82d84b4230e476899):
>>>
>>>  
>>>
>>> winget install wget
>>>
>>> md c:\bin
>>>
>>> wget 
>>> https://raw.githubusercontent.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd
>>>  
>>> -O c:\bin\RefreshEnv.cmd
>>>
>>> setx /M path %path%;c:\bin
>>>
>>>  
>>>
>>> winget install --id Python.Launcher --exact --force
>>>
>>> winget install python.python.3.12 --location c:\apps\python
>>>
>>>  
>>>
>>> refreshenv
>>>
>>> py -0
>>>
>>> where python
>>>
>>>  
>>>
>>> sudo setx /M PIPX_BIN_DIR C:\bin
>>>
>>> sudo setx /M PIPX_HOME C:\apps\pipx
>>>
>>> c:\apps\python\python.exe -m pip install pipx
>>>
>>> c:\apps\python\python.exe -m pipx ensurepath
>>>
>>> refreshenv
>>>
>>>
>>> Choose:
>>>
>>>  
>>>
>>> :: Install latest stable release from pypi.org
>>>
>>> pipx install leo
>>>
>>>  
>>>
>>>     Or: 
>>>
>>> :: Or install latest development from GitHub with git
>>>
>>> pushd %userprofile%\code
>>>
>>> git clone --depth=50 --no-single-branch 
>>> https://github.com/leo-editor/leo-editor
>>>
>>> pipx install --editable ./leo-editor
>>>
>>>  
>>>
>>>     Or:
>>>
>>> :: Or install latest development from source code download
>>>
>>> winget install 7zip
>>>
>>> pushd %userprofile%\Downloads
>>>
>>> wget https://github.com/leo-editor/leo-editor/archive/devel.zip
>>>
>>> 7z x devel.zip -o C:\apps
>>> pipx install --editable C:\apps\leo-editor-devel 
>>>
>>>  
>>>
>>> Resume
>>>
>>>
>>> pipx inject leo websockets
>>>
>>>
>>> leo-messages --version
>>>
>>>  
>>>
>>> :: run Leo to create profile and related, and then exit
>>>
>>> Leo
>>>
>>>  
>>>
>>> :: Register Leo with Windows 
>>>
>>> leo-m 
>>> --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\add-desktop-links.leox
>>>
>>> leo-m 
>>> --script=C:\apps\pipx\venvs\leo\Lib\site-packages\leo\scripts\win\register-leo.leox
>>>
>>>  
>>> Notes 
>>>
>>> Python, pipx, and Leo are installed globally outside of user profile 
>>> directory tree.
>>>
>>> Several listed commands are optional. For example `where python` is 
>>> merely a sanity check to see it it's in PATH and what folder it's in.
>>>
>>>
>>> Pipx is for installing python programs in their own virtual environment, 
>>> so they behave like regular programs that can have independent python 
>>> versions and depencies from other python programs. It's lighter weight than 
>>> conda <https://docs.conda.io/en/latest/> and simpler than managing venvs 
>>> <https://realpython.com/python-virtual-environments-a-primer/> directly.
>>>
>>>
>>> Registering Leo with Windows can be done interactively via "Leo menu >> 
>>> Settings >> Open desktop integration".
>>>
>>>
>>> Websockets is optional, it's for using LeoInteg extension in Visual 
>>> Studio Code.
>>>
>>>
>>> ----
>>>
>>> -matt
>>>
>>> On Saturday, October 14, 2023 at 8:09:53 a.m. UTC-7 Satheesh Vattekkat 
>>> wrote:
>>>
>>>>
>>>> I had python 3.12 installed via scoop already. That failed at PyQt5 
>>>> installation needing vs build tools. That’s when I tried with Anaconda. 
>>>> Will need to check if scoop installs python from python.org or not.
>>>>
>>>> Thanks!
>>>>
>>>> On Saturday, October 14, 2023 at 7:31:44 PM UTC+5:30 tbp1...@gmail.com 
>>>> wrote:
>>>>
>>>>> I'd say this is how to get it installed using Anaconda, which 
>>>>> apparently is not the same as using Python from python.org.  For one 
>>>>> thing, using python.org you don't have to install build tools to 
>>>>> build pyqt5 (and note that Leo will also work with pyqt6) - pip installs 
>>>>> a 
>>>>> pre-built package. 
>>>>>
>>>>> On Saturday, October 14, 2023 at 9:02:27 AM UTC-4 Satheesh Vattekkat 
>>>>> wrote:
>>>>>
>>>>>> Got a new Windows 11 laptop and since I haven't used Windows for a 
>>>>>> while, had to spend some time getting Leo to be installed. Ran into few 
>>>>>> problems along the way - in Linux and OSX it was always a breeze.
>>>>>>
>>>>>> Added what finally worked for me as a gist, if it helps anyone.
>>>>>>
>>>>>> https://gist.github.com/vsbabu/60c85bc61d014df8b7fefb727028c4bb
>>>>>>
>>>>>> Note that this may not be the most elegant way on Windows, but I am 
>>>>>> no Windows expert :) 
>>>>>>
>>>>>> I am running this directly from git cloned directory rather than 
>>>>>> installing that as a pip and then running it. I do a git pull daily and 
>>>>>> so 
>>>>>> far it is all working good for last 3 days.
>>>>>>
>>>>>> HTH
>>>>>>
>>>>>

-- 
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/de1be134-162d-4697-9936-9a570f87c0c1n%40googlegroups.com.

Reply via email to