Fwd: Installation hell

Thomas Passin list1 at tompassin.net
Mon Dec 19 17:53:16 EST 2022


On 12/19/2022 5:16 PM, Chris Angelico wrote:
> On Tue, 20 Dec 2022 at 09:12, Thomas Passin <list1 at tompassin.net> wrote:
>> FWIW, I once set up a Python installation so that it could run from a
>> USB stick (Windows only).  My launcher was a batch file that contained
>> the following:
>>
>> @echo off
>> setlocal
>> : Find effective drive for this file.
>> set ed=%~d0
>> path %ed%\python37\Scripts;%ed%\python37;%PATH%
>> set PYTHONUSERBASE=%ed%\user\python
>> set HOME=%ed%\user\python
>> call python %*
>> endlocal
>>
> 
> So much easier to do on a Unix-like system, where you don't need to
> concern yourself with "effective drive" and can simply use relative
> paths. I know we're not here to bash Windows, but... drive letters
> really need to just die already.

Considering that this was for a removable drive, the launcher needed to 
know its own location, which might change from one instance to another. 
If you look at the code above, you won't find an obvious drive letter. 
You would need to do the equivalent on Linux. The Windows drive letter 
is just not relevant here.

(and I thought we weren't going keep on bashing non-preferred operating 
systems).



More information about the Python-list mailing list