Mailing List Archive

1 2 3  View All
Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more [ In reply to ]
On 1/15/2024 6:27 PM, Greg Ewing via Python-list wrote:
> On 16/01/24 11:55 am, Mats Wichmann wrote:
>> Windows natively has something called python.exe and python3.exe which
>> is interfering here
>
> I'm wondering whether py.exe should be taught to recognise these stubs
> and ignore them. This sounds like something that could trip a lot of
> people up.

There are registry entries that say where all the python.org install
locations are. I suppose, but don't know, that py.exe checks them. The
registry entries are inComputer\HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more [ In reply to ]
On 1/15/2024 7:24 PM, Thomas Passin wrote:
> On 1/15/2024 6:27 PM, Greg Ewing via Python-list wrote:
>> On 16/01/24 11:55 am, Mats Wichmann wrote:
>>> Windows natively has something called python.exe and python3.exe
>>> which is interfering here
>>
>> I'm wondering whether py.exe should be taught to recognise these stubs
>> and ignore them. This sounds like something that could trip a lot of
>> people up.
>
> There are registry entries that say where all the python.org install
> locations are.  I suppose, but don't know, that py.exe checks them.  The
> registry entries are
> in Computer\HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore

For python.org installs that are installed for all users, the entries are in

Computer\HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more [ In reply to ]
Am 15.01.2024 um 23:55 schrieb Mats Wichmann via Python-list:
> On 1/15/24 12:01, Thomas Passin via Python-list wrote:
>> On 1/15/2024 1:26 PM, Mats Wichmann via Python-list wrote:
>> Python from the App Store is not the same as Python from python.org:
>
> yes. this question is about the python.org distribution. but, Windows
> natively has something called python.exe and python3.exe which is
> interfering here, IF the python.org install isn't directed to put itself
> into the path, AND if the "#!/usr/bin/env python3" form is used, causing
> a search in PATH, which is the setup Sibylle has described, unless I've
> misunderstood details.
>

No, you didn't misunderstand any detail. It's exactly right. My Windows
10 box doesn't find anything for "where python", "where python3", while
the new Windows 11 machine finds the Microsoft stub. "Irritating" is a
very friendly attribute for that thing. Why must it be called
"python.exe" and not something else like the installation files from
python.org?

I'll stop using "/env" - hopefully that won't create problems with the
scripts I use in the Linux VM. But in that case I'll know what's up.

Thank you very much!
Sibylle


--
https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more [ In reply to ]
> On 16 Jan 2024, at 17:11, Sibylle Koczian via Python-list <python-list@python.org> wrote:
>
> while the new Windows 11 machine finds the Microsoft stub

You can turn off the stub in windows settings. The magic windows jargon is
“App Execution Aliases”. Once you find it in settings you can turn off
the python and python3 aliases.

Barry




--
https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more [ In reply to ]
On 1/16/24 10:00, Sibylle Koczian via Python-list wrote:
> Am 15.01.2024 um 23:55 schrieb Mats Wichmann via Python-list:
>> On 1/15/24 12:01, Thomas Passin via Python-list wrote:
>>> On 1/15/2024 1:26 PM, Mats Wichmann via Python-list wrote:
>>> Python from the App Store is not the same as Python from python.org:
>>
>> yes. this question is about the python.org distribution. but, Windows
>> natively has something called python.exe and python3.exe which is
>> interfering here, IF the python.org install isn't directed to put
>> itself into the path, AND if the "#!/usr/bin/env python3" form is
>> used, causing a search in PATH, which is the setup Sibylle has
>> described, unless I've misunderstood details.
>>
>
> No, you didn't misunderstand any detail. It's exactly right. My Windows
> 10 box doesn't find anything for "where python", "where python3",

Be interesting to know if your WIndows 10 has those files in place, and
it's just a missing path entry (a good thing, perhaps) that's causing it
not to be found there.

> while the new Windows 11 machine finds the Microsoft stub. "Irritating" is a
> very friendly attribute for that thing. Why must it be called
> "python.exe" and not something else like the installation files from
> python.org?

it will be replaced by the real "python.exe" from the Microsoft Store
install, if you go ahead and install that - I guess that's why that name
was chosen.

> I'll stop using "/env" - hopefully that won't create problems with the
> scripts I use in the Linux VM. But in that case I'll know what's up.
>
> Thank you very much!
> Sibylle
>
>

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more [ In reply to ]
Am 16.01.2024 um 23:44 schrieb Barry via Python-list:
>
>
>> On 16 Jan 2024, at 17:11, Sibylle Koczian via Python-list <python-list@python.org> wrote:
>>
>> while the new Windows 11 machine finds the Microsoft stub
>
> You can turn off the stub in windows settings. The magic windows jargon is
> “App Execution Aliases”. Once you find it in settings you can turn off
> the python and python3 aliases.
>

Thank you! That did it. These two settings were off in the older Windows
10 installation and on in the new Windows 11. Changed there and the
shebang lines with "/env" work as expected.

I didn't remember ever seeing these settings on my "old" computer, but
it seems I turned them off six years ago and completely forgot about
them. Or could that have been an older default?

"python" or "python3" in the shebang line doesn't seem to make a
difference, at least not on machines that never saw Python 2.

Very glad to know what was the matter here,
Sibylle

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more [ In reply to ]
Am 17.01.2024 um 19:44 schrieb Mats Wichmann via Python-list:
>
> Be interesting to know if your WIndows 10 has those files in place, and
> it's just a missing path entry (a good thing, perhaps) that's causing it
> not to be found there.
>
Yes. Python is not on the Path - by design.

>> while the new Windows 11 machine finds the Microsoft stub.

Not any more - see my reply to Barry.

Thanks to all who answered!
Sibylle


--
https://mail.python.org/mailman/listinfo/python-list

1 2 3  View All