Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-23 Thread Sibylle Koczian via Python-list

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


Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-23 Thread Sibylle Koczian via Python-list

Am 16.01.2024 um 23:44 schrieb Barry via Python-list:




On 16 Jan 2024, at 17:11, Sibylle Koczian via Python-list 
 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

2024-01-17 Thread Mats Wichmann via Python-list

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

2024-01-16 Thread Barry via Python-list


> On 16 Jan 2024, at 17:11, Sibylle Koczian via Python-list 
>  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

2024-01-16 Thread Sibylle Koczian via Python-list

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

2024-01-15 Thread Thomas Passin via Python-list

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

2024-01-15 Thread Thomas Passin via Python-list

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

2024-01-15 Thread Greg Ewing via Python-list

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.

--
Greg
--
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

2024-01-15 Thread 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:

On 1/15/24 09:44, Sibylle Koczian via Python-list wrote:


First and foremost I want to understand why I'm seeing this:

- Python scripts with "/usr/bin/env python3" as shebang line work as 
expected on a computer with Windows 10 and Python 3.11.5. They have 
worked for years on this machine, using either the latest Python or 
one version before (depending on availability of some packages). 
There is a virtual machine with ArchLinux on the same machine and 
some of the scripts are copies from that.


- I've got a second computer with Windows 11 and I installed Python 
3.12.1 on it. After copying some scripts from my first computer I 
found that I couldn't start them: not by entering the script name in 
a console, not using py.exe, not double clicking in the explorer. 
Entering \python  probably 
worked - I think I tried that too, but I'm not really sure, because 
that's really not practical.


In the Python documentation for versions 3.11 and 3.12 I found no 
differences regarding py.exe and shebang lines.


Then I removed the "/env" from the shebang lines and could start the 
scripts from the second computer. That certainly is a solution, but 
why???


It's because of Windows itself.  The default nowadays is that 
irritating little stub that prompts you to go install Python from the 
WIndows store.  When you use the "env" form, it looks for python (or 
python3 in your case) in the PATH *first* and you'll get a hit.   Mine 
looks like:


C:\Users\mats\AppData\Local\Microsoft\WindwsApps\python.exe and 
python3.exe


you can check what it's doing for you by using the "where" command in 
a windows shell.


On your older Windows 10 machine you either never had that stub - I 
don't know when it was added, maybe someone from Microsoft listening 
here knows - or it's been superseded by changes to the PATH, or 
something.  On my fairly new Win 11 box the base of that path is early 
in the user portion of PATH, so that must be a default.


py.exe without the "/usr/bin/env" magic doesn't put PATH searching 
first, according to that snip from the docs that's been posted here 
several times., so you shouldn't fall down that particular rathole.


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.




--
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

2024-01-15 Thread Thomas Passin via Python-list

On 1/15/2024 1:26 PM, Mats Wichmann via Python-list wrote:

On 1/15/24 09:44, Sibylle Koczian via Python-list wrote:


First and foremost I want to understand why I'm seeing this:

- Python scripts with "/usr/bin/env python3" as shebang line work as 
expected on a computer with Windows 10 and Python 3.11.5. They have 
worked for years on this machine, using either the latest Python or 
one version before (depending on availability of some packages). There 
is a virtual machine with ArchLinux on the same machine and some of 
the scripts are copies from that.


- I've got a second computer with Windows 11 and I installed Python 
3.12.1 on it. After copying some scripts from my first computer I 
found that I couldn't start them: not by entering the script name in a 
console, not using py.exe, not double clicking in the explorer. 
Entering \python  probably worked 
- I think I tried that too, but I'm not really sure, because that's 
really not practical.


In the Python documentation for versions 3.11 and 3.12 I found no 
differences regarding py.exe and shebang lines.


Then I removed the "/env" from the shebang lines and could start the 
scripts from the second computer. That certainly is a solution, but 
why???


It's because of Windows itself.  The default nowadays is that irritating 
little stub that prompts you to go install Python from the WIndows 
store.  When you use the "env" form, it looks for python (or python3 in 
your case) in the PATH *first* and you'll get a hit.   Mine looks like:


C:\Users\mats\AppData\Local\Microsoft\WindwsApps\python.exe and python3.exe

you can check what it's doing for you by using the "where" command in a 
windows shell.


On your older Windows 10 machine you either never had that stub - I 
don't know when it was added, maybe someone from Microsoft listening 
here knows - or it's been superseded by changes to the PATH, or 
something.  On my fairly new Win 11 box the base of that path is early 
in the user portion of PATH, so that must be a default.


py.exe without the "/usr/bin/env" magic doesn't put PATH searching 
first, according to that snip from the docs that's been posted here 
several times., so you shouldn't fall down that particular rathole.


Python from the App Store is not the same as Python from python.org:

"The Microsoft Store package is a simple installation of Python that is 
suitable for running scripts and packages, and using IDLE or other 
development environments. It requires Windows 10 and above, but can be 
safely installed without corrupting other programs. It also provides 
many convenient commands for launching Python and its tools."


- https://docs.python.org/3/using/windows.html

Also:

"The Windows Store distribution of Python is a sandboxed application ... 
The internal components of Windows Store apps are protected from being 
accessed from other applications, and so the PyXLL add-in cannot use the 
Python DLLs and packages that are installed as part of the Windows Store 
Python app."


From the PyXLL support site -

https://support.pyxll.com/hc/en-gb/articles/4417634326675-Python-installed-via-the-Windows-Store-cannot-be-used-with-PyXLL

The "py" launcher is installed by the installer from python.org.




--
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

2024-01-15 Thread Mats Wichmann via Python-list

On 1/15/24 09:44, Sibylle Koczian via Python-list wrote:

In the Python documentation for versions 3.11 and 3.12 I found no 
differences regarding py.exe and shebang lines.


Then I removed the "/env" from the shebang lines and could start the 
scripts from the second computer. That certainly is a solution, but why???


Sibylle


also, it looks like you can disable the PATH-searching behavior of the 
/usr/bin/env virtual path:


> The environment variable PYLAUNCHER_NO_SEARCH_PATH may be set (to any 
value) to skip this search of PATH.


--
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

2024-01-15 Thread Mats Wichmann via Python-list

On 1/15/24 09:44, Sibylle Koczian via Python-list wrote:


First and foremost I want to understand why I'm seeing this:

- Python scripts with "/usr/bin/env python3" as shebang line work as 
expected on a computer with Windows 10 and Python 3.11.5. They have 
worked for years on this machine, using either the latest Python or one 
version before (depending on availability of some packages). There is a 
virtual machine with ArchLinux on the same machine and some of the 
scripts are copies from that.


- I've got a second computer with Windows 11 and I installed Python 
3.12.1 on it. After copying some scripts from my first computer I found 
that I couldn't start them: not by entering the script name in a 
console, not using py.exe, not double clicking in the explorer. Entering 
\python  probably worked - I think 
I tried that too, but I'm not really sure, because that's really not 
practical.


In the Python documentation for versions 3.11 and 3.12 I found no 
differences regarding py.exe and shebang lines.


Then I removed the "/env" from the shebang lines and could start the 
scripts from the second computer. That certainly is a solution, but why???


It's because of Windows itself.  The default nowadays is that irritating 
little stub that prompts you to go install Python from the WIndows 
store.  When you use the "env" form, it looks for python (or python3 in 
your case) in the PATH *first* and you'll get a hit.   Mine looks like:


C:\Users\mats\AppData\Local\Microsoft\WindwsApps\python.exe and python3.exe

you can check what it's doing for you by using the "where" command in a 
windows shell.


On your older Windows 10 machine you either never had that stub - I 
don't know when it was added, maybe someone from Microsoft listening 
here knows - or it's been superseded by changes to the PATH, or 
something.  On my fairly new Win 11 box the base of that path is early 
in the user portion of PATH, so that must be a default.


py.exe without the "/usr/bin/env" magic doesn't put PATH searching 
first, according to that snip from the docs that's been posted here 
several times., so you shouldn't fall down that particular rathole.


--
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

2024-01-15 Thread Sibylle Koczian via Python-list

Am 15.01.2024 um 00:46 schrieb Mike Dewhirst via Python-list:

In Windows the provided methods for running complex command lines are either a 
batch file or a shortcut.Someone very kindly pointed out to me in this thread 
that there is a PEP for py.exe. I don't use py.exe originally because I didn't 
trust it believing it was a new-fangled Microsoft trick. I did read that PEP 
but it has no relevance for my mixed Windows/Linux environments. On reflection 
I now believe I won't use py.exe because it introduces an unnecessary layer of 
indirection.The  bottom line is that you still need to know which Python a 
particular set of circumstances demands and if you use py.exe you then need to 
also understand how it chooses and how it interprets shebang lines written for 
your Linux environment. And if that isn't your situation I have jumped to the 
wrong conclusion.I have found no problem in Windows when I use shebang lines in 
scripts intended for execution in both Linux and Windows. They are ignored 
unless you use py.exe.My advice is to give up py.exe unless your use case 
mandates shebang lines in Windows.M--(Unsigned mail from my phone)


First and foremost I want to understand why I'm seeing this:

- Python scripts with "/usr/bin/env python3" as shebang line work as 
expected on a computer with Windows 10 and Python 3.11.5. They have 
worked for years on this machine, using either the latest Python or one 
version before (depending on availability of some packages). There is a 
virtual machine with ArchLinux on the same machine and some of the 
scripts are copies from that.


- I've got a second computer with Windows 11 and I installed Python 
3.12.1 on it. After copying some scripts from my first computer I found 
that I couldn't start them: not by entering the script name in a 
console, not using py.exe, not double clicking in the explorer. Entering 
\python  probably worked - I think 
I tried that too, but I'm not really sure, because that's really not 
practical.


In the Python documentation for versions 3.11 and 3.12 I found no 
differences regarding py.exe and shebang lines.


Then I removed the "/env" from the shebang lines and could start the 
scripts from the second computer. That certainly is a solution, but why???


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

2024-01-14 Thread Mike Dewhirst via Python-list
In Windows the provided methods for running complex command lines are either a 
batch file or a shortcut.Someone very kindly pointed out to me in this thread 
that there is a PEP for py.exe. I don't use py.exe originally because I didn't 
trust it believing it was a new-fangled Microsoft trick. I did read that PEP 
but it has no relevance for my mixed Windows/Linux environments. On reflection 
I now believe I won't use py.exe because it introduces an unnecessary layer of 
indirection.The  bottom line is that you still need to know which Python a 
particular set of circumstances demands and if you use py.exe you then need to 
also understand how it chooses and how it interprets shebang lines written for 
your Linux environment. And if that isn't your situation I have jumped to the 
wrong conclusion.I have found no problem in Windows when I use shebang lines in 
scripts intended for execution in both Linux and Windows. They are ignored 
unless you use py.exe.My advice is to give up py.exe unless your use case 
mandates shebang lines in Windows.M--(Unsigned mail from my phone)
 Original message From: Sibylle Koczian via Python-list 
 Date: 14/1/24  23:59  (GMT+10:00) To: 
python-list@python.org Subject: Re: Python 3.12.1, Windows 11: shebang line 
#!/usr/bin/env python3
  doesn't work any more Am 09.01.2024 um 12:36 schrieb Barry Scott via 
Python-list:> > >> On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list 
 wrote:>>>> Oh, and the two Windows and Python versions 
are on two different computers.>>>> Will remove the "/env" from my shebang 
lines, even if I don't understand what's happening.> > Thanks for the details.> 
> Only thing I can think of is that "python" may be defaulting to mean python 
2.> If you use "#!/usr/bin/env python3" it may work on both.No, it doesn't. 
That's the form I started with. When it didn't work I thought "python3" might 
be too old, because Python 2 is dead for so long.> > Did you creates a py.ini 
file to configure py.exe?> > See if you have %userappdata%\py.ini on either 
windows 10 or windows 11.> If so what is its contents?No to both.> > I've tried 
with and without a py.ini and cannot duplicate what you see.> It really seems 
strange. Only thing I can think of - and I don't really believe in that idea: 
as far as I know in Windows 11 the handling of PATH has changed. My Python 
isn't on the path, perhaps that is it. A shebang line without "/env" doesn't 
check the path, right?Thank you for helping,Sibylle-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
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

2024-01-14 Thread Thomas Passin via Python-list

On 1/14/2024 8:54 AM, Thomas Passin via Python-list wrote:

On 1/14/2024 7:48 AM, Sibylle Koczian via Python-list wrote:

Am 09.01.2024 um 12:36 schrieb Barry Scott via Python-list:



On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list 
 wrote:


Oh, and the two Windows and Python versions are on two different 
computers.


Will remove the "/env" from my shebang lines, even if I don't 
understand what's happening.


Thanks for the details.

Only thing I can think of is that "python" may be defaulting to mean 
python 2.

If you use "#!/usr/bin/env python3" it may work on both.


No, it doesn't. That's the form I started with. When it didn't work I 
thought "python3" might be too old, because Python 2 is dead for so long.


Did you creates a py.ini file to configure py.exe?

See if you have %userappdata%\py.ini on either windows 10 or windows 11.
If so what is its contents?


No to both.


I've tried with and without a py.ini and cannot duplicate what you see.



It really seems strange. Only thing I can think of - and I don't 
really believe in that idea: as far as I know in Windows 11 the 
handling of PATH has changed. My Python isn't on the path, perhaps 
that is it. A shebang line without "/env" doesn't check the path, right?


 From what I've read recently, if you have a Python program that starts 
with a shebang line with any of four standard unix-like paths, then 
Python (not Windows) will look for a version of Python in standard 
locations - *NOT* in the shebang line locations:


I meant to write "the Python launcher", that is, the "py" program. 
Normal Python installs on Windows install the launcher and Windows will 
run it on ".py" files if no other program has been specified on the 
command line.


"To allow shebang lines in Python scripts to be portable between Unix 
and Windows, this launcher supports a number of ‘virtual’ commands to 
specify which interpreter to use. The supported virtual commands are:


/usr/bin/env
/usr/bin/python
/usr/local/bin/python
python
"

Also -
"The /usr/bin/env form of shebang line has one further special property. 
Before looking for installed Python interpreters, this form will search 
the executable PATH for a Python executable matching the name provided 
as the first argument. This corresponds to the behaviour of the Unix env 
program, which performs a PATH search. If an executable matching the 
first argument after the env command cannot be found, but the argument 
starts with python, it will be handled as described for the other 
virtual commands.

"

There are some other complications, too, depending on whether you 
specify bare "python" or some specific version. The form with 
"/usr/bin/env" is the closest to the unix behavior, in that it searches 
the PATH.  And you write that your intended version of Python is not on 
the path.


IOW, these shebang lines don't work the way you seem to think that they do.

See https://docs.python.org/3/using/windows.html for a more complete 
rundown.


--
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

2024-01-14 Thread Thomas Passin via Python-list

On 1/14/2024 7:48 AM, Sibylle Koczian via Python-list wrote:

Am 09.01.2024 um 12:36 schrieb Barry Scott via Python-list:



On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list 
 wrote:


Oh, and the two Windows and Python versions are on two different 
computers.


Will remove the "/env" from my shebang lines, even if I don't 
understand what's happening.


Thanks for the details.

Only thing I can think of is that "python" may be defaulting to mean 
python 2.

If you use "#!/usr/bin/env python3" it may work on both.


No, it doesn't. That's the form I started with. When it didn't work I 
thought "python3" might be too old, because Python 2 is dead for so long.


Did you creates a py.ini file to configure py.exe?

See if you have %userappdata%\py.ini on either windows 10 or windows 11.
If so what is its contents?


No to both.


I've tried with and without a py.ini and cannot duplicate what you see.



It really seems strange. Only thing I can think of - and I don't really 
believe in that idea: as far as I know in Windows 11 the handling of 
PATH has changed. My Python isn't on the path, perhaps that is it. A 
shebang line without "/env" doesn't check the path, right?


From what I've read recently, if you have a Python program that starts 
with a shebang line with any of four standard unix-like paths, then 
Python (not Windows) will look for a version of Python in standard 
locations - *NOT* in the shebang line locations:


"To allow shebang lines in Python scripts to be portable between Unix 
and Windows, this launcher supports a number of ‘virtual’ commands to 
specify which interpreter to use. The supported virtual commands are:


/usr/bin/env
/usr/bin/python
/usr/local/bin/python
python
"

Also -
"The /usr/bin/env form of shebang line has one further special property. 
Before looking for installed Python interpreters, this form will search 
the executable PATH for a Python executable matching the name provided 
as the first argument. This corresponds to the behaviour of the Unix env 
program, which performs a PATH search. If an executable matching the 
first argument after the env command cannot be found, but the argument 
starts with python, it will be handled as described for the other 
virtual commands.

"

There are some other complications, too, depending on whether you 
specify bare "python" or some specific version. The form with 
"/usr/bin/env" is the closest to the unix behavior, in that it searches 
the PATH.  And you write that your intended version of Python is not on 
the path.


IOW, these shebang lines don't work the way you seem to think that they do.

See https://docs.python.org/3/using/windows.html for a more complete 
rundown.

--
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

2024-01-14 Thread Sibylle Koczian via Python-list

Am 09.01.2024 um 12:36 schrieb Barry Scott via Python-list:




On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list 
 wrote:

Oh, and the two Windows and Python versions are on two different computers.

Will remove the "/env" from my shebang lines, even if I don't understand what's 
happening.


Thanks for the details.

Only thing I can think of is that "python" may be defaulting to mean python 2.
If you use "#!/usr/bin/env python3" it may work on both.


No, it doesn't. That's the form I started with. When it didn't work I 
thought "python3" might be too old, because Python 2 is dead for so long.


Did you creates a py.ini file to configure py.exe?

See if you have %userappdata%\py.ini on either windows 10 or windows 11.
If so what is its contents?


No to both.


I've tried with and without a py.ini and cannot duplicate what you see.



It really seems strange. Only thing I can think of - and I don't really 
believe in that idea: as far as I know in Windows 11 the handling of 
PATH has changed. My Python isn't on the path, perhaps that is it. A 
shebang line without "/env" doesn't check the path, right?


Thank you for helping,
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

2024-01-09 Thread Barry Scott via Python-list



> On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list 
>  wrote:
> 
> Oh, and the two Windows and Python versions are on two different computers.
> 
> Will remove the "/env" from my shebang lines, even if I don't understand 
> what's happening.

Thanks for the details.

Only thing I can think of is that "python" may be defaulting to mean python 2.
If you use "#!/usr/bin/env python3" it may work on both.

Did you creates a py.ini file to configure py.exe?

See if you have %userappdata%\py.ini on either windows 10 or windows 11.
If so what is its contents?

I've tried with and without a py.ini and cannot duplicate what you see.

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

2024-01-07 Thread Sibylle Koczian via Python-list

Am 01.01.2024 um 12:50 schrieb Barry via Python-list:




On 1 Jan 2024, at 11:14, Sibylle Koczian via Python-list 
 wrote:

But in all this thread I didn't see a single explanation for my current 
situation: one and the same shebang line works on Windows 10 / Python 3.11 and 
doesn't work on Windows 11 / Python 3.12. I suspect Windows, because a change 
in the way Python 3.12 uses shebang lines should be visible in the 
documentation.


See my earlier reply with info on ftype etc output.
What do you see on your windows 10 vs windows 11?



Oh yes, I forgot to answer, here are my results:

py -0:
1. Windows 10, Python 3.11.5:
 -V:3.11 *Python 3.11 (64-bit)
 -V:3.6   Python 3.6 (64-bit) possibly part of Visual Studio or 
else Calibre?

2. Windows 11, Python 3.12.1;
 -V:3.12 *Python 3.12 (64-bit)

assoc .py
1. Windows 10, Python 3.11.5:
.py=Python.File
2. Windows 11, Python 3.12.1:
.py=Python.File

ftype Python.File
1. Windows 10, Python 3.11.5:
Python.File="C:\WINDOWS\py.exe" "%L" %*
2. Windows 11, Python 3.12.1:
Python.file="C:\Windows\py.exe" "%L" %*

Test Script test_shebang.py starts with one of these shebang lines:
a) #! python
b) #! /usr/bin/python
c) #! /usr/bin/env python
import sys
print(sys.executable)

Results:
1. Windows 10, Python 3.11.5:
test_shebang.py, Version a): C:\Program Files\Python311\python.exe
py test_shebang.py, Version a): C:\Program Files\Python311\python.exe

test_shebang.py, Version b): C:\Program Files\Python311\python.exe
py test_shebang.py, Version b): C:\Program Files\Python311\python.exe

test_shebang.py, Version c): C:\Program Files\Python311\python.exe
py test_shebang.py, Version c): C:\Program Files\Python311\python.exe

2. Windows 11, Python 3.12.1:
test_shebang.py, Version a): C:\Program Files\Python312\python.exe
py test_shebang.py, Version a): C:\Program Files\Python312\python.exe

test_shebang.py, Version b): C:\Program Files\Python312\python.exe
py test_shebang.py, Version b): C:\Program Files\Python312\python.exe

test_shebang.py, Version c):
Python konnte nicht gefunden werden. F³hren Sie die Verkn³pfung ohne 
Argumente aus, um sie ³ber den Microsoft Store zu installieren, oder 
deaktivieren Sie diese Verkn³pfung unter


py test_shebang.py, Version c):
Python konnte nicht gefunden werden. F³hren Sie die Verkn³pfung ohne 
Argumente aus, um sie ³ber den Microsoft Store zu installieren, oder 
deaktivieren Sie diese Verkn³pfung unter


It's a german Windows version, first sentence: "Python could not be 
found". I don't really know how to translate the second sentence.


Oh, and the two Windows and Python versions are on two different computers.

Will remove the "/env" from my shebang lines, even if I don't understand 
what's happening.


Thank you for helping,
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

2024-01-03 Thread Barry Scott via Python-list



> On 2 Jan 2024, at 17:24, Thomas Passin via Python-list 
>  wrote:
> 
> You might learn about this if you happen to read and remember the right part 
> of the Python docs.  Otherwise you have no idea what py.exe is up to nor how 
> it does it.  I would say that most people don't know there's an ini file, let 
> alone what it can do.  Of course this situation isn't unique to py.exe!

On discuss.python.org we will share the link to the python windows docs and
often to this specific section: 
https://docs.python.org/3/using/windows.html#python-launcher-for-windows

To create a py.ini does require a user to understand what %localappdata% means.
Some windows users, reasonable, do not use the CLI and know about that syntax 
for environment variables.

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

2024-01-02 Thread Thomas Passin via Python-list

On 1/2/2024 11:56 AM, Mats Wichmann via Python-list wrote:

On 1/1/24 12:53, Thomas Passin via Python-list wrote:

On Windows 10, a shebang line gets ignored in favor of Python 3.9.9 
(if invoked by the script name alone) or Python 3.12.1 (if invoked by 
the "py" launcher).


fwiw, you can also create an ini file to define to the launcher py which 
version should be the default, if no version is specified.


You might learn about this if you happen to read and remember the right 
part of the Python docs.  Otherwise you have no idea what py.exe is up 
to nor how it does it.  I would say that most people don't know there's 
an ini file, let alone what it can do.  Of course this situation isn't 
unique to py.exe!


--
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

2024-01-02 Thread Mats Wichmann via Python-list

On 1/1/24 12:53, Thomas Passin via Python-list wrote:

On Windows 10, a shebang line gets ignored in favor of Python 3.9.9 (if 
invoked by the script name alone) or Python 3.12.1 (if invoked by the 
"py" launcher).


fwiw, you can also create an ini file to define to the launcher py which 
version should be the default, if no version is specified.




--
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

2024-01-01 Thread Thomas Passin via Python-list

On 1/1/2024 12:26 PM, Mats Wichmann via Python-list wrote:

On 1/1/24 07:11, Thomas Passin via Python-list wrote:

Here's how to find out what program Windows thinks it should use to 
run a ".py" file.  In a console:


C:\Users\tom>assoc .py
.py=Python.File

C:\Users\tom>ftype Python.file
Python.file="C:\Windows\py.exe" "%L" %*


That's not enough. There is now (has been for a while) a layered system, 
and this gives you just one layer, there may be other associations that 
win out.


Per somebody who actually knows:

 > The only way to determine the association without reimplmenting the 
shell's search is to simply ask the shell via AssocQueryString. Possibly 
PowerShell can provide this information. – Eryk Sun


"Possibly", eh?  In fact, on my system those layers must be in effect, 
since ftype claims that the "py" launcher will be used but in actual 
fact the old Python 3.9.9 is used instead, as I wrote earlier.  This is 
verified by this tiny Python script:


# Optional shebang line here
import sys
print(sys.executable)

Then run it with "py", a proposed shebang line, its plain name on the 
command line, whatever.  That will tell you for sure which Python 
executable gets launched by which technique.


On Windows 10, a shebang line gets ignored in favor of Python 3.9.9 (if 
invoked by the script name alone) or Python 3.12.1 (if invoked by the 
"py" launcher).


--
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

2024-01-01 Thread Mats Wichmann via Python-list

On 1/1/24 07:11, Thomas Passin via Python-list wrote:

Here's how to find out what program Windows thinks it should use to run 
a ".py" file.  In a console:


C:\Users\tom>assoc .py
.py=Python.File

C:\Users\tom>ftype Python.file
Python.file="C:\Windows\py.exe" "%L" %*


That's not enough. There is now (has been for a while) a layered system, 
and this gives you just one layer, there may be other associations that 
win out.


Per somebody who actually knows:

> The only way to determine the association without reimplmenting the 
shell's search is to simply ask the shell via AssocQueryString. Possibly 
PowerShell can provide this information. – Eryk Sun



--
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

2024-01-01 Thread Mats Wichmann via Python-list

On 1/1/24 04:02, Sibylle Koczian via Python-list wrote:

Am 30.12.2023 um 04:04 schrieb Mike Dewhirst via Python-list:


I had assumed the OP had installed Python from the Microsoft shop and 
that's where py.exe must have come from.




In fact I didn't say in my post that I always get Python from 
python.org. When I started to use the language there was no Python from 
any Microsoft shop (I'm not sure there was a Microsoft shop, it was in 
the last millenium, Python 1.5 or 1.6). So I tend to forget that 
possible download source.


But in all this thread I didn't see a single explanation for my current 
situation: one and the same shebang line works on Windows 10 / Python 
3.11 and doesn't work on Windows 11 / Python 3.12. I suspect Windows, 
because a change in the way Python 3.12 uses shebang lines should be 
visible in the documentation.


The shebang support in the Python Launcher is documented here:

https://docs.python.org/3/using/windows.html#shebang-lines

That says the line you list originally:

> My shebang line is usually "#!/usr/bin/env python3"

means look for python3 in PATH.  Do you have one? If you don't have one, 
you'll get one you don't want: the stupid Microsoft shim that, which if 
run interactively, encourages you to install from the Microsoft store. 
You should be able to disable this.


File suffix associations are a different thing - they give me no end of 
headaches on Windows. They start out bound to the shim, and should 
rebind to the launcher when you install, but then things can steal it. 
If you install Visual Studio Code with Python extensions, then it takes 
over the running of .py files - if you click in the explorer, you'll get 
it open in the editor, not run.  I've argued about this, to no avail 
(plays havoc with my testsuite, which in some places tries to execute 
Python scripts as a cli command).


And then I've got this:

C:\Users\mats\SOMEWHERE>py -0
 -V:3.13  Python 3.13 (64-bit)
 -V:3.12 *Python 3.12 (64-bit)
 -V:3.11  Python 3.11 (64-bit)
 -V:3.10  Python 3.10 (64-bit)
 -V:3.9   Python 3.9 (64-bit)
 -V:3.8   Python 3.8 (64-bit)
 -V:3.7   Python 3.7 (64-bit)
 -V:3.6   Python 3.6 (64-bit)

# Okay, it knows about lots of Python versions, and shows a default of 3.12

C:\Users\mats\SOMEWHERE>py
Python 3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 
64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

# Great, that works just as expected

C:\Users\mats\SOMEWHERE>py test.py
Python was not found; run without arguments to install from the 
Microsoft Store, or disable this shortcut from Settings > Manage App 
Execution Aliases.


# wait, what? if "py" worked, why doesn't "py test.py"?


--
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

2024-01-01 Thread Thomas Passin via Python-list

On 1/1/2024 8:19 AM, Thomas Passin via Python-list wrote:

On 1/1/2024 6:02 AM, Sibylle Koczian via Python-list wrote:

Am 30.12.2023 um 04:04 schrieb Mike Dewhirst via Python-list:


I had assumed the OP had installed Python from the Microsoft shop and 
that's where py.exe must have come from.




In fact I didn't say in my post that I always get Python from 
python.org. When I started to use the language there was no Python 
from any Microsoft shop (I'm not sure there was a Microsoft shop, it 
was in the last millenium, Python 1.5 or 1.6). So I tend to forget 
that possible download source.


But in all this thread I didn't see a single explanation for my 
current situation: one and the same shebang line works on Windows 10 / 
Python 3.11 and doesn't work on Windows 11 / Python 3.12. I suspect 
Windows, because a change in the way Python 3.12 uses shebang lines 
should be visible in the documentation.


Happy new year to all!
Sibylle


Happy New Year!

I speculated that the shebang line didn't work on Windows 10 either, but 
you didn't realize it because the file associations were right to launch 
".py" programs with the right version of Python.  When the newer version 
of Python got installed, the default Python program to use, was not 
updated correctly, and the shebang line still has nothing to do with the 
launch failure.  This could happen if other the older install went into 
Program Files, while the newer one went into 
%USERPROFILE%\AppData\Local\Programs\Python.


This was backed up with all of 5 minutes of experimenting on my own 
computer, on which Windows launches ".py" programs with an old install 
of Python 3.9.9, but the py launcher launches Python 3.12 by default.


Since I am avoiding Windows 11, I can't try anything on it, so my 
thoughts above may not be relevant.


The Python docs for 3.12.1 cover shebang lines at

https://docs.python.org/3/using/windows.html

"If the first line of a script file starts with #!, it is known as a 
“shebang” line. Linux and other Unix like operating systems have native 
support for such lines and they are commonly used on such systems to 
indicate how a script should be executed. This launcher allows the same 
facilities to be used with Python scripts on Windows and the examples 
above demonstrate their use.


To allow shebang lines in Python scripts to be portable between Unix and 
Windows, this launcher supports a number of ‘virtual’ commands to 
specify which interpreter to use. The supported virtual commands are:


/usr/bin/env
/usr/bin/python
/usr/local/bin/python
python

For example, if the first line of your script starts with

#! /usr/bin/python
The default Python will be located and used. As many Python scripts 
written to work on Unix will already have this line, you should find 
these scripts can be used by the launcher without modification. If you 
are writing a new script on Windows which you hope will be useful on 
Unix, you should use one of the shebang lines starting with /usr."


But

"The /usr/bin/env form of shebang line has one further special property. 
Before looking for installed Python interpreters, this form will search 
the executable PATH for a Python executable matching the name provided 
as the first argument. This corresponds to the behaviour of the Unix env 
program, which performs a PATH search. If an executable matching the 
first argument after the env command cannot be found, but the argument 
starts with python, it will be handled as described for the other 
virtual commands. The environment variable PYLAUNCHER_NO_SEARCH_PATH may 
be set (to any value) to skip this search of PATH.


Shebang lines that do not match any of these patterns are looked up in 
the [commands] section of the launcher’s .INI file. This may be used to 
handle certain commands in a way that makes sense for your system. The 
name of the command must be a single argument (no spaces in the shebang 
executable), and the value substituted is the full path to the 
executable (additional arguments specified in the .INI will be quoted as 
part of the filename)."




Here's how to find out what program Windows thinks it should use to run 
a ".py" file.  In a console:


C:\Users\tom>assoc .py
.py=Python.File

C:\Users\tom>ftype Python.file
Python.file="C:\Windows\py.exe" "%L" %*

If your ".py" files are associated to the py.exe launcher, as mine are, 
then the launcher may try to use your shebang line and you need to make 
sure there aren't any spaces where there shouldn't be.


If your ".py" files are not associated with py.exe, the shebang line 
probably won't be used for anything.



--
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

2024-01-01 Thread Thomas Passin via Python-list

On 1/1/2024 6:02 AM, Sibylle Koczian via Python-list wrote:

Am 30.12.2023 um 04:04 schrieb Mike Dewhirst via Python-list:


I had assumed the OP had installed Python from the Microsoft shop and 
that's where py.exe must have come from.




In fact I didn't say in my post that I always get Python from 
python.org. When I started to use the language there was no Python from 
any Microsoft shop (I'm not sure there was a Microsoft shop, it was in 
the last millenium, Python 1.5 or 1.6). So I tend to forget that 
possible download source.


But in all this thread I didn't see a single explanation for my current 
situation: one and the same shebang line works on Windows 10 / Python 
3.11 and doesn't work on Windows 11 / Python 3.12. I suspect Windows, 
because a change in the way Python 3.12 uses shebang lines should be 
visible in the documentation.


Happy new year to all!
Sibylle


Happy New Year!

I speculated that the shebang line didn't work on Windows 10 either, but 
you didn't realize it because the file associations were right to launch 
".py" programs with the right version of Python.  When the newer version 
of Python got installed, the default Python program to use, was not 
updated correctly, and the shebang line still has nothing to do with the 
launch failure.  This could happen if other the older install went into 
Program Files, while the newer one went into 
%USERPROFILE%\AppData\Local\Programs\Python.


This was backed up with all of 5 minutes of experimenting on my own 
computer, on which Windows launches ".py" programs with an old install 
of Python 3.9.9, but the py launcher launches Python 3.12 by default.


Since I am avoiding Windows 11, I can't try anything on it, so my 
thoughts above may not be relevant.


The Python docs for 3.12.1 cover shebang lines at

https://docs.python.org/3/using/windows.html

"If the first line of a script file starts with #!, it is known as a 
“shebang” line. Linux and other Unix like operating systems have native 
support for such lines and they are commonly used on such systems to 
indicate how a script should be executed. This launcher allows the same 
facilities to be used with Python scripts on Windows and the examples 
above demonstrate their use.


To allow shebang lines in Python scripts to be portable between Unix and 
Windows, this launcher supports a number of ‘virtual’ commands to 
specify which interpreter to use. The supported virtual commands are:


/usr/bin/env
/usr/bin/python
/usr/local/bin/python
python

For example, if the first line of your script starts with

#! /usr/bin/python
The default Python will be located and used. As many Python scripts 
written to work on Unix will already have this line, you should find 
these scripts can be used by the launcher without modification. If you 
are writing a new script on Windows which you hope will be useful on 
Unix, you should use one of the shebang lines starting with /usr."


But

"The /usr/bin/env form of shebang line has one further special property. 
Before looking for installed Python interpreters, this form will search 
the executable PATH for a Python executable matching the name provided 
as the first argument. This corresponds to the behaviour of the Unix env 
program, which performs a PATH search. If an executable matching the 
first argument after the env command cannot be found, but the argument 
starts with python, it will be handled as described for the other 
virtual commands. The environment variable PYLAUNCHER_NO_SEARCH_PATH may 
be set (to any value) to skip this search of PATH.


Shebang lines that do not match any of these patterns are looked up in 
the [commands] section of the launcher’s .INI file. This may be used to 
handle certain commands in a way that makes sense for your system. The 
name of the command must be a single argument (no spaces in the shebang 
executable), and the value substituted is the full path to the 
executable (additional arguments specified in the .INI will be quoted as 
part of the filename)."



--
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

2024-01-01 Thread Barry via Python-list



> On 1 Jan 2024, at 11:14, Sibylle Koczian via Python-list 
>  wrote:
> 
> But in all this thread I didn't see a single explanation for my current 
> situation: one and the same shebang line works on Windows 10 / Python 3.11 
> and doesn't work on Windows 11 / Python 3.12. I suspect Windows, because a 
> change in the way Python 3.12 uses shebang lines should be visible in the 
> documentation.

See my earlier reply with info on ftype etc output.
What do you see on your windows 10 vs windows 11?

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

2024-01-01 Thread Sibylle Koczian via Python-list

Am 30.12.2023 um 04:04 schrieb Mike Dewhirst via Python-list:


I had assumed the OP had installed Python from the Microsoft shop and 
that's where py.exe must have come from.




In fact I didn't say in my post that I always get Python from 
python.org. When I started to use the language there was no Python from 
any Microsoft shop (I'm not sure there was a Microsoft shop, it was in 
the last millenium, Python 1.5 or 1.6). So I tend to forget that 
possible download source.


But in all this thread I didn't see a single explanation for my current 
situation: one and the same shebang line works on Windows 10 / Python 
3.11 and doesn't work on Windows 11 / Python 3.12. I suspect Windows, 
because a change in the way Python 3.12 uses shebang lines should be 
visible in the documentation.


Happy new year to all!
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

2023-12-29 Thread Chris Angelico via Python-list
On Sat, 30 Dec 2023 at 14:06, Mike Dewhirst via Python-list
 wrote:
>
> On 29/12/2023 12:09 pm, Félix An via Python-list wrote:
> > On 2023-12-25 12:36, Mike Dewhirst wrote:
> >>
> >> 3. You cannot trust Microsoft. You can trust Python Software
> >> Foundation. Python from PSF works the same in all environments - or
> >> if not it is a bug. Python from Microsoft is tweaked to satisfy their
> >> aforementioned strategy of locking in users to Windows.
> >>
> >
> > I strongly disagree with this.
>
> Not sure which part of the above you strongly disagree with. I might
> seem a bit OTT with "You cannot trust Microsoft" but I did put it in a
> specific context.
>
> PSF does try to make Python work identically in all operating systems it
> supports. The OP was using py.exe which I discovered (just now - and it
> is why I'm writing this) exists on my Windows 10 machine. I have never
> installed any Python other than personally downloaded from the
> python.org website - therefore py.exe must have come from PSF!
>
> I had assumed the OP had installed Python from the Microsoft shop and
> that's where py.exe must have come from.
>
> I learn something every day.

If you'd done a little research, you might have found this:

https://peps.python.org/pep-0397/

Yes, it is from the official launcher. I don't see why you'd expect
Microsoft to go to the effort of building their own launcher when it
can be available for every Python user.

> > I don't get all the irrational hate for Microsoft that exists within
> > the Linux community.
>
> Perhaps you are too young to remember when Steve Ballmer was head of
> Microsoft?

How relevant is this?

I remember the days when OS/2 was the big target, and Microsoft was
the greatest anti-OS/2 voice out there. Does that affect the way I use
tools today? Is it even slightly relevant?

I remember when Intel had floating-point division issues in their
FPUs. Do I tell people "don't do floating-point math on Intel
processors"? Is it relevant?

ChrisA
-- 
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

2023-12-29 Thread Mike Dewhirst via Python-list

On 29/12/2023 12:09 pm, Félix An via Python-list wrote:

On 2023-12-25 12:36, Mike Dewhirst wrote:


3. You cannot trust Microsoft. You can trust Python Software 
Foundation. Python from PSF works the same in all environments - or 
if not it is a bug. Python from Microsoft is tweaked to satisfy their 
aforementioned strategy of locking in users to Windows.




I strongly disagree with this.


Not sure which part of the above you strongly disagree with. I might 
seem a bit OTT with "You cannot trust Microsoft" but I did put it in a 
specific context.


PSF does try to make Python work identically in all operating systems it 
supports. The OP was using py.exe which I discovered (just now - and it 
is why I'm writing this) exists on my Windows 10 machine. I have never 
installed any Python other than personally downloaded from the 
python.org website - therefore py.exe must have come from PSF!


I had assumed the OP had installed Python from the Microsoft shop and 
that's where py.exe must have come from.


I learn something every day.

I don't get all the irrational hate for Microsoft that exists within 
the Linux community.


Perhaps you are too young to remember when Steve Ballmer was head of 
Microsoft?


He specifically and loudly hated Linux and developed the anti-linux 
culture/strategy within Microsoft. If memory serves correctly he called 
it a virus. That was in the context of trying to get rid of Linux in 
Europe (Germany I think) where it had gained a small municipal foothold. 
Microsoft eventually succeeded in reversing that public mistake.


In recent years, Microsoft has made great contributions to the 
everyday life of Linux users. VS Code is based on open source and 
available on Linux, .NET is now on Linux, Windows has WSL2 and Visual 
Studio Linux development tools to help you develop software for Linux, 
SQL Server (despite still being commercial software except for the 
Express and Developer versions) is on Linux, etc.


I only use Linux on servers without GUI. I have used Windows desktop 
since it was released because most of my clients used it. I had no 
choice. I have been watching what they do for decades.


I agree they appear to have become more civilised in recent years.

M

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.



OpenPGP_signature.asc
Description: OpenPGP digital signature
-- 
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

2023-12-28 Thread Chris Angelico via Python-list
On Fri, 29 Dec 2023 at 12:23, Félix An via Python-list
 wrote:
>
> On 2023-12-25 12:36, Mike Dewhirst wrote:
> >
> > 3. You cannot trust Microsoft. You can trust Python Software Foundation. 
> > Python from PSF works the same in all environments - or if not it is a bug. 
> > Python from Microsoft is tweaked to satisfy their aforementioned strategy 
> > of locking in users to Windows.
> >
>
> I strongly disagree with this. I don't get all the irrational hate for
> Microsoft that exists within the Linux community.

It's worth noting that Mike Dewhirst is NOT a spokesman for the Linux
community. One of the cool benefits freedom brings is that anyone's
allowed to be wrong :)

Not ALL of us hate Microsoft. I store the vast majority of my code on
GitHub, and it didn't make any difference when MS bought that company
(it was already a company, and their interests were always to make
money, and that was okay with me).

ChrisA
-- 
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

2023-12-28 Thread Félix An via Python-list

On 2023-12-25 12:36, Mike Dewhirst wrote:


3. You cannot trust Microsoft. You can trust Python Software Foundation. Python 
from PSF works the same in all environments - or if not it is a bug. Python 
from Microsoft is tweaked to satisfy their aforementioned strategy of locking 
in users to Windows.



I strongly disagree with this. I don't get all the irrational hate for 
Microsoft that exists within the Linux community. In recent years, 
Microsoft has made great contributions to the everyday life of Linux 
users. VS Code is based on open source and available on Linux, .NET is 
now on Linux, Windows has WSL2 and Visual Studio Linux development tools 
to help you develop software for Linux, SQL Server (despite still being 
commercial software except for the Express and Developer versions) is on 
Linux, etc.

--
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

2023-12-25 Thread Mike Dewhirst via Python-list
Well spotted Chris. 4 was a generalisation based on my own 
circumstances.However, I'm not wrong about Microsoft motivationsM--(Unsigned 
mail from my phone)
 Original message From: Chris Angelico via Python-list 
 Date: 25/12/23  15:57  (GMT+10:00) To: Michael Torrie 
via Python-list  Subject: Re: Python 3.12.1, Windows 
11: shebang line #!/usr/bin/env python3
  doesn't work any more On Mon, 25 Dec 2023 at 15:42, Mike Dewhirst via 
Python-list wrote:>> Apologies for top posting - my 
phone seems unable to do otherwise.>> Here's my view - which may not be 
popular.You're right about that part, anyhow :)> 4. Shebang lines are pretty 
much redundant now that most python interpreters are run from venvsStrongly 
dispute that. The rest. you're entitled to your opinions(they happen to be 
wrong, but you're entitled to them :) ), but thisis a statement of fact that I 
would need to see some evidence for.ChrisA-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
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

2023-12-25 Thread rbowman via Python-list
On Sun, 24 Dec 2023 22:55:34 +, Barry wrote:

>> On 24 Dec 2023, at 00:54, rbowman via Python-list
>>  wrote:
>> 
>> Does that work with virtualenv or conda? I'm slowly getting up to speed
>> with those.
> 
> Conda is its own thing, not need for py.exe.
> 
> Once you have created the venv you do not need py.exe as you will have
> pythob.exe in the venv bin folder.


Thanks. That's what I have been doing and have never used py.exe. For 
context Esri distributes ArcPy as a scripting language using 3.9. By 
default the base install can't be modified so if you want additional 
libraries or a tool like Spyder it has to be in a virtual. 
-- 
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

2023-12-24 Thread Chris Angelico via Python-list
On Mon, 25 Dec 2023 at 15:42, Mike Dewhirst via Python-list
 wrote:
>
> Apologies for top posting - my phone seems unable to do otherwise.
>
> Here's my view - which may not be popular.

You're right about that part, anyhow :)

> 4. Shebang lines are pretty much redundant now that most python interpreters 
> are run from venvs

Strongly dispute that. The rest. you're entitled to your opinions
(they happen to be wrong, but you're entitled to them :) ), but this
is a statement of fact that I would need to see some evidence for.

ChrisA
-- 
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

2023-12-24 Thread Mike Dewhirst via Python-list
Apologies for top posting - my phone seems unable to do otherwise.

Here's my view - which may not be popular.

1. Py.exe is an awful idea. 

2. Installing python in %PROGRAMFILES% is not a good idea

3. Installing Python from a Microsoft shop or server is a bad idea

4. Shebang lines are pretty much redundant now that most python interpreters 
are run from venvs

5. Shebang lines have never had a place in Windows

TL;DR

1. Py.exe is not a standard python thing and learning to rely on it is 
following Microsoft's marketing strategy. That strategy has served them 
brilliantly since the 1980s. They make their environment just different enough 
to force users to invest brainspace to make it work and thereby lock-in their 
users with their own muscle-memory. Very subtle. Not.

2. Installing Python in Microsoft's preferred location wasn't always 
"standard". Python downloaded from python.org always defaulted to C:\PythonXXX. 
I'm not saying that was a perfect location but at least it was (in my case 
still is) nicely visible for researching multiple different pythons. Putting 
deep in Program files does nothing other than hide it. 

3. You cannot trust Microsoft. You can trust Python Software Foundation. Python 
from PSF works the same in all environments - or if not it is a bug. Python 
from Microsoft is tweaked to satisfy their aforementioned strategy of locking 
in users to Windows.

4. Shebang lines are a fallback if you don't wish to type the interpreter 
location before typing your script name. You must know your interpreter 
location to get the shebang line right. Shebangs were never intended as primary 
devices. They are linux/unix things.

5. Shebangs on Windows are a new opportunity for Microsoft to plough its own 
furrow. They are difficult to handle simply because of 4 above.

To finish this rant, I believe it is far better to aim for standardisation 
rather than subtle and annoying differences deliberately designed to supplant 
standards in favour of market dominance.

Merry Christmas all

Cheers

Mike




On 24 December 2023 3:35:42 am AEDT, Michael Torrie via Python-list 
 wrote:
>On 12/22/23 20:56, Thomas Passin via Python-list wrote:
>> It's just better not to make assumptions about which version of Python 
>> will be running. Just specify it yourself when you can, and then you can 
>> be sure.
>
>Precisely, which is why the shebang is so useful, even on Windows with
>py launcher.  For example, set the shebang to:
>
>#!/usr/bin/python3.6
>
>And py launcher will always try to run it with Python 3.6.
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list
-- 
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

2023-12-24 Thread Barry via Python-list



> On 24 Dec 2023, at 00:54, rbowman via Python-list  
> wrote:
> 
> Does that work with virtualenv or conda? I'm slowly getting up to speed
> with those.

Conda is its own thing, not need for py.exe.

Once you have created the venv you do not need py.exe as you will have 
pythob.exe in the venv bin folder.

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

2023-12-23 Thread Michael Torrie via Python-list
On 12/22/23 20:16, rbowman via Python-list wrote:
> On Fri, 22 Dec 2023 17:27:58 -0700, Michael Torrie wrote:
> 
>> Using the py launcher as your Windows association with .py and.pyw files
>> you can have multiple versions of python installed and everything works
>> as it should, according to your shebang, just like on Unix.
> 
> Does that work with virtualenv or conda? I'm slowly getting up to speed 
> with those.

I don't know. I imagine py is aware of venv if you run it from the
command line within the activated venv.  But I doubt it is if you launch
the python script by double-clicking on it from Explorer.

-- 
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

2023-12-23 Thread rbowman via Python-list
On Fri, 22 Dec 2023 17:27:58 -0700, Michael Torrie wrote:

> Using the py launcher as your Windows association with .py and.pyw files
> you can have multiple versions of python installed and everything works
> as it should, according to your shebang, just like on Unix.

Does that work with virtualenv or conda? I'm slowly getting up to speed 
with those.
-- 
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

2023-12-23 Thread Michael Torrie via Python-list
On 12/22/23 20:56, Thomas Passin via Python-list wrote:
> It's just better not to make assumptions about which version of Python 
> will be running. Just specify it yourself when you can, and then you can 
> be sure.

Precisely, which is why the shebang is so useful, even on Windows with
py launcher.  For example, set the shebang to:

#!/usr/bin/python3.6

And py launcher will always try to run it with Python 3.6.

-- 
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

2023-12-23 Thread Barry Scott via Python-list



> On 23 Dec 2023, at 03:01, Thomas Passin via Python-list 
>  wrote:
> 
> Not on my system. It may depend on whether Python gets installed to Program 
> Files or to %USERPROFILE%/AppData/Local/Programs/Python.  Python 3.9 is the 
> last verson I installed to Program Files, and that's the version that Windows 
> thinks it should use to run Python files.
> 
> Run the little test program I posted.  That will tell you which version of 
> Python the system wants to use.

I always install for all users and this what I get on my Windows 10 and 11 
systems.
As you can see the shebang lines do what is expected based on the config of 
py.exe.

Maybe it works differently if you install for a single user only,
I do not have such a setup to test with.

Windows 10 output.

K:\shebang>py -0 
 -V:3.13  Python 3.13 (64-bit)
 -V:3.13-32   Python 3.13 (32-bit)
 -V:3.12 *Python 3.12 (64-bit)
 -V:3.12-32   Python 3.12 (32-bit)
 -V:3.11  Python 3.11 (64-bit)
 -V:3.11-32   Python 3.11 (32-bit)
 -V:3.10  Python 3.10 (64-bit)
 -V:3.10-32   Python 3.10 (32-bit)
 -V:3.9   Python 3.9 (64-bit)
 -V:3.9-32Python 3.9 (32-bit)
 -V:3.8   Python 3.8 (64-bit)
 -V:3.8-32Python 3.8 (32-bit)
 -V:3.7   Python 3.7 (64-bit)
 -V:3.7-32Python 3.7 (32-bit)
 -V:3.6   Python 3.6 (64-bit)
 -V:3.6-32Python 3.6 (32-bit)
 -V:3.5   Python 3.5
 -V:3.5-32Python 3.5-32
 -V:3.4   Python 3.4
 -V:3.4-32Python 3.4-32
 -V:2.7   Python 2.7
 -V:2.7-32Python 2.7-32

K:\shebang>type shebang_py2.py 
#!/usr/bin/python2
from __future__ import print_function
import sys
print('I am python %r' % (sys.version_info,))

K:\shebang>py shebang_py2.py 
I am python sys.version_info(major=2, minor=7, micro=17, releaselevel='final', 
serial=0)

K:\shebang>shebang_py2.py
I am python sys.version_info(major=2, minor=7, micro=17, releaselevel='final', 
serial=0)

K:\shebang>type shebang_py3.py 
#!/usr/bin/python3
from __future__ import print_function
import sys
print('I am python %r' % (sys.version_info,))

K:\shebang>py shebang_py3.py 
I am python sys.version_info(major=3, minor=12, micro=1, releaselevel='final', 
serial=0)

K:\shebang>shebang_py3.py
I am python sys.version_info(major=3, minor=12, micro=1, releaselevel='final', 
serial=0)

K:\shebang>type shebang_env_py3.py 
#!/usr/bin/env python3
from __future__ import print_function
import sys
print('I am python %r' % (sys.version_info,))

K:\shebang>py shebang_env_py3.py 
I am python sys.version_info(major=3, minor=12, micro=1, releaselevel='final', 
serial=0)

K:\shebang>shebang_env_py3.py
I am python sys.version_info(major=3, minor=12, micro=1, releaselevel='final', 
serial=0)

K:\shebang>type shebang_env_py3_10.py 
#!/usr/bin/env python3.10
from __future__ import print_function
import sys
print('I am python %r' % (sys.version_info,))

K:\shebang>py shebang_env_py3_10.py 
I am python sys.version_info(major=3, minor=10, micro=11, releaselevel='final', 
serial=0)

K:\shebang>shebang_env_py3_10.py
I am python sys.version_info(major=3, minor=10, micro=11, releaselevel='final', 
serial=0)

K:\shebang>assoc .py 
.py=Python.File

K:\shebang>ftype Python.File 
Python.File="C:\WINDOWS\py.exe" "%L" %*


Windows 11 output


: 11:52:10.36 K:\shebang
: \\BARNSTONE\barry> py -0 
 -V:3.12 *Python 3.12 (64-bit)
 -V:3.12-32   Python 3.12 (32-bit)
 -V:3.11  Python 3.11 (64-bit)
 -V:3.11-32   Python 3.11 (32-bit)
 -V:3.10  Python 3.10 (64-bit)
 -V:3.9   Python 3.9 (64-bit)
 -V:3.9-32Python 3.9 (32-bit)
 -V:3.8   Python 3.8 (64-bit)
 -V:3.8-32Python 3.8 (32-bit)

: 11:52:10.40 K:\shebang
: \\BARNSTONE\barry> type shebang_py2.py 
#!/usr/bin/python2
from __future__ import print_function
import sys
print('I am python %r' % (sys.version_info,))

: 11:52:10.41 K:\shebang
: \\BARNSTONE\barry> py shebang_py2.py 
No suitable Python runtime found
Pass --list (-0) to see all detected environments on your machine
or set environment variable PYLAUNCHER_ALLOW_INSTALL to use winget
or open the Microsoft Store to the requested version.

: 11:52:10.47 K:\shebang
: \\BARNSTONE\barry> type shebang_py3.py 
#!/usr/bin/python3
from __future__ import print_function
import sys
print('I am python %r' % (sys.version_info,))

: 11:52:10.49 K:\shebang
: \\BARNSTONE\barry> py shebang_py3.py 
I am python sys.version_info(major=3, minor=12, micro=0, releaselevel='final', 
serial=0)

: 11:52:10.52 K:\shebang
: \\BARNSTONE\barry> shebang_py3.py
I am python sys.version_info(major=3, minor=12, micro=0, releaselevel='final', 
serial=0)

: 11:52:10.58 K:\shebang
: \\BARNSTONE\barry> type shebang_env_py3.py 
#!/usr/bin/env python3
from __future__ import print_function
import sys
print('I am python %r' % (sys.version_info,))

: 11:52:10.60 K:\shebang
: \\BARNSTONE\barry> py shebang_env_py3.py 
I am python sys.version_info(major=3, minor=12, micro=0, 

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-23 Thread Peter J. Holzer via Python-list
On 2023-12-22 22:56:45 -0500, Thomas Passin via Python-list wrote:
> In my experience one should always make sure to know what version of Python
> is being used, at least if there is more than one version installed on the
> computer.  Even on Linux using a shebang line can be tricky, because you are
> likely to get the system's version of Python,

You are not "likely" to get the system's version of Python, you get the
version of Python you specify. If you specify "/usr/bin/python3", that's
the system's version of Python. If you specify something else, you get
something else. If you specify "/usr/bin/env python3", you get whatever
the user has in their PATH first.


> and that often is not what you want.  OTOH you don't want to go
> symlinking python3 to some other version of python because then the OS
> system may not work right.  So either you have to specify the Python
> version in the shebang,

This. In my considered opinion installed scripts should work regardless
pf the user's PATH, so they must have the correct interpreter in the
shebang. That specifying the correct shebang pulls in the complete
virtual environment is IMHO a great feature of Python.

I've written a small script "install-python" which basically just copies
a file and adjusts the shebang line.

for the use in Makefiles etc.

> or just specify the right version
> on the command line.  In that case you might as well not have included the
> shebang line at all.

Right. However, that's not how scripts are usually invoked on Unix.
Using /usr/bin/env in the command line is supposed to fix that but of
course it assumes that your interpreter is actually called python3.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
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

2023-12-22 Thread Thomas Passin via Python-list

On 12/22/2023 7:27 PM, Michael Torrie via Python-list wrote:

On 12/22/23 07:02, Thomas Passin via Python-list wrote:

On my Windows 10 machine, Python scripts run without a shebang line.
Perhaps Windows 11 has added the ability to use one, but then you would
need to use the actual location of your Python executable.


Yes if you associate .py or .pyw with python.exe (or pythonw.exe), then
things work as you describe.  However it's no longer recommended to do
that.

Instead---and I think this is the default now when you install
python---you should associate both .py and .pyw files with the py
launcher (py.exe) and it will examine the shebang line of the script and
determine which version of python to run. As I said this should work
regardless of the path listed in the shebang.  Note that the shebang is
meaningless to Windows itself, and Windows Explorer. It is only
meaningful to the py launcher.  So it's customary to just use a
unix-style shebang in your python scripts.  So either #!/usr/bin/python3
or #!/usr/bin/env python3 as you would in unix.

Using the py launcher as your Windows association with .py and.pyw files
you can have multiple versions of python installed and everything works
as it should, according to your shebang, just like on Unix.


I actually don't remember how to set up the association for Python 
files.  I just always type the "py" launcher anyway, as in


py -m pip instal ...

I think that the association with py.exe must only happen if you install 
to Program Files.  As I said in my previous post, Windows still sticks 
with launching Python files with Python 3.9 even though I'm three 
version beyond that.  3.9 is the only one I installed to Program Files.


In my experience one should always make sure to know what version of 
Python is being used, at least if there is more than one version 
installed on the computer.  Even on Linux using a shebang line can be 
tricky, because you are likely to get the system's version of Python, 
and that often is not what you want.  OTOH you don't want to go 
symlinking python3 to some other version of python because then the OS 
system may not work right.  So either you have to specify the Python 
version in the shebang, or just specify the right version on the command 
line.  In that case you might as well not have included the shebang line 
at all.


I may be more sensitive to this issue because I run many different Linux 
distros in VMs to check a few programs I support to make sure they can 
run on Linux as well as Windows.  What Linux, you ask?  Well, who knows 
what our users will use? So I'm always getting Python version 
mix-and-match problems.  The system will still be at Python 3.10 but I 
need Python 3.11.  The system uses Python 3.11 but we shouldn't (or 
cannot) install our dependencies so we need a parallel install.  Etc, etc.


It's just better not to make assumptions about which version of Python 
will be running. Just specify it yourself when you can, and then you can 
be sure.

--
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

2023-12-22 Thread Thomas Passin via Python-list

On 12/22/2023 7:19 PM, Barry wrote:




On 23 Dec 2023, at 00:15, Thomas Passin via Python-list 
 wrote:

In neither case is the shebang line used.


As i understand it, not in front of my windows box to check.
The handler for .py file extension is set to be the py.exe
It is py.exe that understands shebang lines.


Not on my system. It may depend on whether Python gets installed to 
Program Files or to %USERPROFILE%/AppData/Local/Programs/Python.  Python 
3.9 is the last verson I installed to Program Files, and that's the 
version that Windows thinks it should use to run Python files.


Run the little test program I posted.  That will tell you which version 
of Python the system wants to use.

--
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

2023-12-22 Thread Michael Torrie via Python-list
On 12/22/23 07:02, Thomas Passin via Python-list wrote:
> On my Windows 10 machine, Python scripts run without a shebang line. 
> Perhaps Windows 11 has added the ability to use one, but then you would 
> need to use the actual location of your Python executable.

Yes if you associate .py or .pyw with python.exe (or pythonw.exe), then
things work as you describe.  However it's no longer recommended to do
that.

Instead---and I think this is the default now when you install
python---you should associate both .py and .pyw files with the py
launcher (py.exe) and it will examine the shebang line of the script and
determine which version of python to run. As I said this should work
regardless of the path listed in the shebang.  Note that the shebang is
meaningless to Windows itself, and Windows Explorer. It is only
meaningful to the py launcher.  So it's customary to just use a
unix-style shebang in your python scripts.  So either #!/usr/bin/python3
or #!/usr/bin/env python3 as you would in unix.

Using the py launcher as your Windows association with .py and.pyw files
you can have multiple versions of python installed and everything works
as it should, according to your shebang, just like on Unix.
-- 
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

2023-12-22 Thread Michael Torrie via Python-list
On 12/22/23 11:42, Thomas Passin via Python-list wrote:
> There is some important context that is missing here.  Python on Windows 
> does not normally install to that location.  That is not even a Windows 
> path, neither by directory name nor by path separators.

No, that's just the way the py launcher on Windows has always worked in
the past. This way you can take a script from a nix system and drop it
in Windows and it has half a chance of running through the launcher,
from Windows explorer, or by running py myscript.py at the command
propmpt.  The Py launcher essentially ignores (or used to ignore) the
path in the shebang and focuses on what version of Python it should fire
up.
-- 
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

2023-12-22 Thread Barry via Python-list



> On 23 Dec 2023, at 00:15, Thomas Passin via Python-list 
>  wrote:
> 
> In neither case is the shebang line used.

As i understand it, not in front of my windows box to check.
The handler for .py file extension is set to be the py.exe
It is py.exe that understands shebang lines.

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

2023-12-22 Thread Thomas Passin via Python-list

On 12/22/2023 9:29 AM, Sibylle Koczian via Python-list wrote:

Am 22.12.2023 um 14:13 schrieb Barry:



On 22 Dec 2023, at 12:39, Sibylle Koczian via Python-list 
 wrote:


Hello,

I always install Python on Windows in the same manner:

- Python is not on the path,
- it is installed for all users,
- the Python Launcher is installed for all users,
- the file types .py, .pyw etc. are associated with Python.

My shebang line is usually "#!/usr/bin/env python3".

This has always worked well. I could run Python scripts in a console
window entering just the script name, by double clicking in the explorer
or using WIN+r; the two last variants for GUI or for scripts with
something like "input('Leave with Enter')" at the end.

Now I've got a new computer with Windows 11 and I've installed Python
3.12.1. On my older machine it's Windows 10 and Python 3.11.5. Reading
the Python documentation it seems my shebang lines should work as before
- but they don't. The error message:

"Unable to create process using 'C:\usr\bin\env\python
"C:\Eigen\Src\launcher_versuche.py" ': Das System kann die angegebene
Datei nicht finden."

Without the "env" in the shebang line and only without it everything
works as expected - but that's contrary to the documentation, isn't it?


This suggests a typo in the shebang line. Is there a space between env 
and python?


Barry



Tried several variants with the same script:

#!/usr/bin/env python3
# That's how I wrote it for Windows 10 / Python 3.11. It works there.

#!/usr/bin/env python
#!/usr/bin/env/python

The error messages vary a little. This is a German Windows installation,
the two variants with the space produce the same German error message,
the third produces the message I've put into my first description.

The working variant on Windows 11 / Python 3.12 is "#!/usr/bin python".


There is some important context that is missing here.  Python on Windows 
does not normally install to that location.  That is not even a Windows 
path, neither by directory name nor by path separators.


In addition, Powershell and cmd.exe do not use a shebang line, at least 
through Windows 10.  Instead, they use whatever executable has been 
registered for a file extension.  This may or may not be the version you 
think.  On my system, the OS will use Python 3.9, but actually the most 
recent Python version on my system is Python 3.12. I can demonstrate the 
difference:  here is a tiny Python file with a shebang line, called 
showme.py:


#! %USERPROFILE%\AppData\Local\Programs\Python\Python312\python.exe
import sys
print(sys.executable)

Run this with the "py" launcher:
py showme.py
# prints C:\Users\tom\AppData\Local\Programs\Python\Python312\python.exe

Run it by invoking just the script's name:
showme.py
# prints C:\Program Files\Python39\python.exe

In neither case is the shebang line used.

This makes me think that maybe the Linux subsystem for Windows is being 
used here. If so, possibly the syntax for a shebang line has been 
tightened up, or there's a typo.  Either way, I would not automatically 
assume that Windows (at least through Windows 10) ever used the shebang 
line for launching these scripts.




--
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

2023-12-22 Thread Thomas Passin via Python-list

On 12/22/2023 7:36 AM, Sibylle Koczian via Python-list wrote:

Hello,

I always install Python on Windows in the same manner:

- Python is not on the path,
- it is installed for all users,
- the Python Launcher is installed for all users,
- the file types .py, .pyw etc. are associated with Python.

My shebang line is usually "#!/usr/bin/env python3".

This has always worked well. I could run Python scripts in a console
window entering just the script name, by double clicking in the explorer
or using WIN+r; the two last variants for GUI or for scripts with
something like "input('Leave with Enter')" at the end.

Now I've got a new computer with Windows 11 and I've installed Python
3.12.1. On my older machine it's Windows 10 and Python 3.11.5. Reading
the Python documentation it seems my shebang lines should work as before
- but they don't. The error message:

"Unable to create process using 'C:\usr\bin\env\python
"C:\Eigen\Src\launcher_versuche.py" ': Das System kann die angegebene
Datei nicht finden."

Without the "env" in the shebang line and only without it everything
works as expected - but that's contrary to the documentation, isn't it?


How is a path for a linux location going to work on a Windows machine? 
On Windows, when you click on a script the OS tries to find the program 
that has been registered to run that script. Python would not have been 
installed to "C:\usr\bin\env\python".


On my Windows 10 machine, Python scripts run without a shebang line. 
Perhaps Windows 11 has added the ability to use one, but then you would 
need to use the actual location of your Python executable.


If you have several Python installations, it's better to run Python 
scripts using the "py" launcher, because Windows may have the wrong idea 
about which version to use.  The "where" command on my computer shows 
Python 3.9, but I'm actually using Python 12.


--
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

2023-12-22 Thread Barry via Python-list



> On 22 Dec 2023, at 14:58, Christian Buhtz via Python-list 
>  wrote:
> 
> On Windows 11 it usually is the "Terminal" which is different from cmd.exe.

In terminal app you can run cmd.exe or powershell, so it is basically the same.

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

2023-12-22 Thread Barry via Python-list



> On 22 Dec 2023, at 14:29, Sibylle Koczian  wrote:
> 
> #!/usr/bin/env/python

That was what i thought you had and it will not work.

The BOM suggestion is worth trying.

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

2023-12-22 Thread Christian Buhtz via Python-list

What is the "command line" on your Windows 11?

On Windows 10 it usually is "cmd.exe" (Windows Command Prompt).
On Windows 11 it usually is the "Terminal" which is different from 
cmd.exe.

--
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

2023-12-22 Thread J.O. Aho via Python-list

On 22/12/2023 13.36, Sibylle Koczian wrote:

Hello,

I always install Python on Windows in the same manner:

- Python is not on the path,
- it is installed for all users,
- the Python Launcher is installed for all users,
- the file types .py, .pyw etc. are associated with Python.

My shebang line is usually "#!/usr/bin/env python3".


Disable BOM in your editor and re-save all files.

--
 //Aho
--
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

2023-12-22 Thread Sibylle Koczian via Python-list

Am 22.12.2023 um 14:13 schrieb Barry:




On 22 Dec 2023, at 12:39, Sibylle Koczian via Python-list 
 wrote:

Hello,

I always install Python on Windows in the same manner:

- Python is not on the path,
- it is installed for all users,
- the Python Launcher is installed for all users,
- the file types .py, .pyw etc. are associated with Python.

My shebang line is usually "#!/usr/bin/env python3".

This has always worked well. I could run Python scripts in a console
window entering just the script name, by double clicking in the explorer
or using WIN+r; the two last variants for GUI or for scripts with
something like "input('Leave with Enter')" at the end.

Now I've got a new computer with Windows 11 and I've installed Python
3.12.1. On my older machine it's Windows 10 and Python 3.11.5. Reading
the Python documentation it seems my shebang lines should work as before
- but they don't. The error message:

"Unable to create process using 'C:\usr\bin\env\python
"C:\Eigen\Src\launcher_versuche.py" ': Das System kann die angegebene
Datei nicht finden."

Without the "env" in the shebang line and only without it everything
works as expected - but that's contrary to the documentation, isn't it?


This suggests a typo in the shebang line. Is there a space between env and 
python?

Barry



Tried several variants with the same script:

#!/usr/bin/env python3
# That's how I wrote it for Windows 10 / Python 3.11. It works there.

#!/usr/bin/env python
#!/usr/bin/env/python

The error messages vary a little. This is a German Windows installation,
the two variants with the space produce the same German error message,
the third produces the message I've put into my first description.

The working variant on Windows 11 / Python 3.12 is "#!/usr/bin python".

Thank you,
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

2023-12-22 Thread Barry via Python-list


> On 22 Dec 2023, at 12:39, Sibylle Koczian via Python-list 
>  wrote:
> 
> Hello,
> 
> I always install Python on Windows in the same manner:
> 
> - Python is not on the path,
> - it is installed for all users,
> - the Python Launcher is installed for all users,
> - the file types .py, .pyw etc. are associated with Python.
> 
> My shebang line is usually "#!/usr/bin/env python3".
> 
> This has always worked well. I could run Python scripts in a console
> window entering just the script name, by double clicking in the explorer
> or using WIN+r; the two last variants for GUI or for scripts with
> something like "input('Leave with Enter')" at the end.
> 
> Now I've got a new computer with Windows 11 and I've installed Python
> 3.12.1. On my older machine it's Windows 10 and Python 3.11.5. Reading
> the Python documentation it seems my shebang lines should work as before
> - but they don't. The error message:
> 
> "Unable to create process using 'C:\usr\bin\env\python
> "C:\Eigen\Src\launcher_versuche.py" ': Das System kann die angegebene
> Datei nicht finden."
> 
> Without the "env" in the shebang line and only without it everything
> works as expected - but that's contrary to the documentation, isn't it?

This suggests a typo in the shebang line. Is there a space between env and 
python?

Barry


> 
> Thank you for information,
> Sibylle
> --
> https://mail.python.org/mailman/listinfo/python-list
> 

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


Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Sibylle Koczian via Python-list

Hello,

I always install Python on Windows in the same manner:

- Python is not on the path,
- it is installed for all users,
- the Python Launcher is installed for all users,
- the file types .py, .pyw etc. are associated with Python.

My shebang line is usually "#!/usr/bin/env python3".

This has always worked well. I could run Python scripts in a console
window entering just the script name, by double clicking in the explorer
or using WIN+r; the two last variants for GUI or for scripts with
something like "input('Leave with Enter')" at the end.

Now I've got a new computer with Windows 11 and I've installed Python
3.12.1. On my older machine it's Windows 10 and Python 3.11.5. Reading
the Python documentation it seems my shebang lines should work as before
- but they don't. The error message:

"Unable to create process using 'C:\usr\bin\env\python
"C:\Eigen\Src\launcher_versuche.py" ': Das System kann die angegebene
Datei nicht finden."

Without the "env" in the shebang line and only without it everything
works as expected - but that's contrary to the documentation, isn't it?

Thank you for information,
Sibylle
--
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-15 Thread Eryk Sun via Python-list
On 6/15/23, Thomas Schweikle via Python-list  wrote:
>
> No. This flag is not inherited. Someone has to set it for created
> directories. It is easy to confirm: take a directory not under MSYS or
> cygwin control (because it is mounted by MSYS or cygwin), set the flag,
> then create directories. They all will have caseSensitivInfo disabled.

That was how the attribute was implemented initially in Windows 10,
but subsequently it was made inheritable. For example:

C:\Temp\test>mkdir spam
C:\Temp\test>fsutil file setCaseSensitiveInfo spam enable
Error:  Access is denied.

Setting the case-sensitive attribute requires the right to add files
and directories (i.e. "WD" = "write data" / "add file"; "AD" = "append
data" / "add subdirectory") and the right to remove files and
directories (i.e. "DC" = "delete child"). The owner of a directory
doesn't necessarily inherit these rights from the parent directory
(which is my case here), but the owner of any object usually has the
implicit right to modify discretionary security. Let's simply grant
the owner (i.e. "OW" = "owner rights") full control of the directory
(i.e. "F"), inheritable to child directories (i.e. "CI" = "container
inherit").

C:\Temp\test>icacls spam /grant *OW:(CI)(F)
processed file: spam
Successfully processed 1 files; Failed processing 0 files

C:\Temp\test>fsutil file setCaseSensitiveInfo spam enable
Case sensitive attribute on directory C:\Temp\test\spam is enabled.

Now, create a child directory and confirm that it inherits the
case-sensitive flag.

C:\Temp\test>mkdir spam\eggs
C:\Temp\test>fsutil file queryCaseSensitiveInfo spam\eggs
Case sensitive attribute on directory C:\Temp\test\spam\eggs is enabled.

> Python itself isn't the problem here. It is MSBuild.exe. For some reason
> this tool lowercases sometimes whole paths to files included. This does
> not matter if case sensitivity is disabled. It matters if case
> sensitivity is enabled! There is no reason MSBUild.exe does it. But it
> is done for some paths (as someone else pointed out).

For the specific problem you had when building 3.10 and 3.11, it's
actually a bug in Python's source code, which is no longer present in
3.12+. It can be fixed in 3.11, but 3.10 no longer gets bug fixes.
Here's the link to the issue on GitHub:

https://github.com/python/cpython/issues/105737

I encountered a different bug when building the main branch. Building
the _decimal extension module includes an .asm file. The relative path
in the project file has the correct case, but the build system
resolved the fully-qualified path as all lower case. This problem only
occurred for this single file, out of hundreds of relative paths in
the project files, so it's not like the build system is completely
broken when working in case-sensitive directories.

There are probably a few such bugs that need to be fixed in msbuild,
the compiler, and linker. After all, these tools have been developed
and tested for decades on only case-insensitive filesystems. But you
don't have to be on the bleeding edge. There's no reason to make
directories case-sensitive for repositories that are intended for use
on Windows, such as CPython.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-15 Thread Thomas Schweikle via Python-list



Am Do., 15.Juni.2023 um 16:28:21 schrieb Eryk Sun:

On 6/15/23, Thomas Schweikle via Python-list  wrote:


In this case: not sure what is going on.


Possibly you have a setting configured that affects the behavior of
Git via the MinGW-w64 runtime, such that calling mkdir() ends up
calling NtSetInformationFile() to set the FileCaseSensitiveInformation
for the directory.


It is a mount option for MSYS or cygwin controlled parts of the file 
system. posix=1 switches case sensitivity on, posix=0 switches it off.


MSYS or cygwin are then make caseSensitiveInfo "inheritated" by setting 
this flag for all newly created directories. This is a feature of the 
latest cygwin-dll. It might not be seen on older variants.



Does the mkdir command in Git bash create a case-sensitive directory?
It doesn't for me. I have to manually enable case sensitivity via
`chattr +C`.

What do you get for `which git` and `git --version`?

 $ which git
 /mingw64/bin/git

 $ git --version
 git version 2.41.0.windows.1


the same:
$ which git
/mingw64/bin/git

$ git --version
git version 2.41.0.windows.1

And in cmd.exe:
+>where git
C:\Program Files\Git\bin\git.exe

+>git --version
git version 2.41.0.windows.1


$ fsutil file queryCaseSensitiveInfo .


The MSYS2 environment includes lsattr and chattr commands, with the
case-sensitive flag mapped to "C". It's probably more convenient than
typing `fsutil file queryCaseSensitiveInfo` or `fsutil file
setCaseSensitiveInfo`.

 $ lsattr -d test
  test
 $ chattr +C test
 $ lsattr -d test
 ---C test


True. But if you frequently change between environments fsutil is the 
command working in cmd.exe as in git-shell.



core.ignorecase is not regarded in any way. It does not mater if it is
set or not.


Git tests the case-sensitivity of the target directory to configure
core.ignorecase when cloning a repo. If it's case insensitive, then
core.ignorecase is enabled. This overrides the global value. AFAIK,
the ignorecase setting is unrelated to actually setting the case
sensitivity of created directories; it just affects how Git behaves on
a case-insensitive filesystem.


--
Thomas



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-15 Thread Thomas Schweikle via Python-list


Am Do., 15.Juni.2023 um 15:44:42 schrieb Inada Naoki:

Then, git doesn't enable Windows NTFS case sensitivity.

You enabled NTFS case sensitivity on "C:\Users\user\K".
And Windows enabled case sensitivity for all new directories under the
directory.


No. This flag is not inherited. Someone has to set it for created 
directories. It is easy to confirm: take a directory not under MSYS or 
cygwin control (because it is mounted by MSYS or cygwin), set the flag, 
then create directories. They all will have caseSensitivInfo disabled.



Since it is not default and minor setting, it is not a bug that
current Python doesn't support building on case sensitive directory.
But I think it is a nice improvement if next Python supports it.


Python itself isn't the problem here. It is MSBuild.exe. For some reason 
this tool lowercases sometimes whole paths to files included. This does 
not matter if case sensitivity is disabled. It matters if case 
sensitivity is enabled! There is no reason MSBUild.exe does it. But it 
is done for some paths (as someone else pointed out).




Regards,

--
Inada Naoki  


--
Thomas



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-15 Thread Eryk Sun via Python-list
On 6/15/23, Thomas Schweikle via Python-list  wrote:
>
> In this case: not sure what is going on.

Possibly you have a setting configured that affects the behavior of
Git via the MinGW-w64 runtime, such that calling mkdir() ends up
calling NtSetInformationFile() to set the FileCaseSensitiveInformation
for the directory.

Does the mkdir command in Git bash create a case-sensitive directory?
It doesn't for me. I have to manually enable case sensitivity via
`chattr +C`.

What do you get for `which git` and `git --version`?

$ which git
/mingw64/bin/git

$ git --version
git version 2.41.0.windows.1

> $ fsutil file queryCaseSensitiveInfo .

The MSYS2 environment includes lsattr and chattr commands, with the
case-sensitive flag mapped to "C". It's probably more convenient than
typing `fsutil file queryCaseSensitiveInfo` or `fsutil file
setCaseSensitiveInfo`.

$ lsattr -d test
 test
$ chattr +C test
$ lsattr -d test
---C test

> core.ignorecase is not regarded in any way. It does not mater if it is
> set or not.

Git tests the case-sensitivity of the target directory to configure
core.ignorecase when cloning a repo. If it's case insensitive, then
core.ignorecase is enabled. This overrides the global value. AFAIK,
the ignorecase setting is unrelated to actually setting the case
sensitivity of created directories; it just affects how Git behaves on
a case-insensitive filesystem.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-15 Thread Inada Naoki via Python-list
Then, git doesn't enable Windows NTFS case sensitivity.

You enabled NTFS case sensitivity on "C:\Users\user\K".
And Windows enabled case sensitivity for all new directories under the
directory.

Since it is not default and minor setting, it is not a bug that
current Python doesn't support building on case sensitive directory.
But I think it is a nice improvement if next Python supports it.

Regards,

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


Re: Compiling python on windows with vs

2023-06-15 Thread Thomas Schweikle via Python-list



Am Mi., 14.Juni.2023 um 15:10:50 schrieb Eryk Sun:

On 6/14/23, Inada Naoki via Python-list  wrote:

Since Git enables Windows NTFS case sensitivity while checking out sources


I didn't know that. Would you give us a link to this feature?
As far as I know, `git config core.ignorecase` doesn't mean NTFS case
sensitive.


If a repo is cloned into a case-insensitive directory, then
core.ignorecase should be enabled automatically. If a repo is cloned
into a case-sensitive directory, then core.ignorecase should not be
enabled automatically.

I searched through relevant issues on the Git for Windows repo on
GitHub, and I found nothing to indicate that a capability to
automatically enable NTFS case sensitivity has been added. I searched
through the source of Git and Git for Windows, and I didn't find any
references to WinAPI SetFileInformationByHandle: FileCaseSensitiveInfo
or NTAPI NtSetInformationFile: FileCaseSensitiveInformation, nor the
use of fsutil file setCaseSensitiveInfo.


In this case: not sure what is going on. In a git-shell on Windows:
If caseSensitiveInfo is disabled:
user@host MINGW64 ~/K
$ fsutil file queryCaseSensitiveInfo .
Das Attribut für Groß-/Kleinschreibung für das Verzeichnis
"C:\Users\user\K" ist deaktiviert.

$ git config --global -l
core.ignorecase=true

$ git clone https://github.com/python/cpython.git
Cloning into 'cpython'...
remote: Enumerating objects: 956870, done.
remote: Counting objects: 100% (1304/1304), done.
remote: Compressing objects: 100% (801/801), done.
Receiving objects: 100% (956870/956870), 557.02 MiB | 9.75 MiB/s, done.55566

Resolving deltas: 100% (760802/760802), done.
Updating files: 100% (4488/4488), done.

$ find . -type d -exec fsutil.exe file queryCaseSensitiveInfo {} \;
does not show any directory having caseSensitiveInfo enabled.

If caseSesitiveInfo is enabled:
user@host MINGW64 ~/K
$ fsutil file queryCaseSensitiveInfo .
Das Attribut für Groß-/Kleinschreibung für das Verzeichnis
"C:\Users\user\K" ist aktiviert.

$ git config --global -l
core.ignorecase=true

$ git clone https://github.com/python/cpython.git
Cloning into 'cpython'...
remote: Enumerating objects: 956870, done.
remote: Counting objects: 100% (1304/1304), done.
remote: Compressing objects: 100% (801/801), done.
Receiving objects: 100% (956870/956870), 557.02 MiB | 9.75 MiB/s, done.55566

Resolving deltas: 100% (760802/760802), done.
Updating files: 100% (4488/4488), done.

$ find . -type d -exec fsutil.exe file queryCaseSensitiveInfo {} \;
All directories created by git have caseSensitiveInfo enabled.

core.ignorecase is not regarded in any way. It does not mater if it is 
set or not.


--
Thomas



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-14 Thread Eryk Sun via Python-list
On 6/14/23, Inada Naoki via Python-list  wrote:
>> Since Git enables Windows NTFS case sensitivity while checking out sources
>
> I didn't know that. Would you give us a link to this feature?
> As far as I know, `git config core.ignorecase` doesn't mean NTFS case
> sensitive.

If a repo is cloned into a case-insensitive directory, then
core.ignorecase should be enabled automatically. If a repo is cloned
into a case-sensitive directory, then core.ignorecase should not be
enabled automatically.

I searched through relevant issues on the Git for Windows repo on
GitHub, and I found nothing to indicate that a capability to
automatically enable NTFS case sensitivity has been added. I searched
through the source of Git and Git for Windows, and I didn't find any
references to WinAPI SetFileInformationByHandle: FileCaseSensitiveInfo
or NTAPI NtSetInformationFile: FileCaseSensitiveInformation, nor the
use of fsutil file setCaseSensitiveInfo.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-13 Thread Inada Naoki via Python-list
> Since Git enables Windows NTFS case sensitivity while checking out sources

I didn't know that. Would you give us a link to this feature?
As far as I know, `git config core.ignorecase` doesn't mean NTFS case
sensitive.

On Wed, Jun 14, 2023 at 1:57 AM Thomas Schweikle via Python-list <
python-list@python.org> wrote:

> Hi!
>
> Trying to compile python on windows leads to following error:
>
>_testimportmultiple.vcxproj ->
>
> C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\amd64\_testimportmultiple.pyd
>_testmultiphase.c
>   Bibliothek
> "C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\amd64\_testmultiphase.lib"
>
> und Objekt "C:\Users\sct-muc\Docume
>nts\Projekte\cpython\PCbuild\amd64\_testmultiphase.exp" werden erstellt.
>Code wird generiert.
>Codegenerierung ist abgeschlossen.
>_testmultiphase.vcxproj ->
>
> C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\amd64\_testmultiphase.pyd
>_testconsole.c
> C:\Users\sct-muc\Documents\Projekte\cpython\PC\_testconsole.c(13,10):
> fatal  error C1083: Datei (Include) kann nicht geöffnet werde
> n: "..\modules\_io\_iomodule.h": No such file or directory
> [C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\_testconsole.vcxpro
> j]
>
> Fehler beim Buildvorgang.
>
> if I rename "Modules" to "modules" it will find
> "..\modules\_io\_iomodule.h" but wont find "..\Modules\..."
>
> Since Git enables Windows NTFS case sensitivity while checking out
> sources ... is it a bug or a "feature"? And: is there a simple
> workaround available besides disabling case sensitivity (which will
> break others)?
> --
> Thomas
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


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


Re: Compiling python on windows with vs

2023-06-13 Thread Thomas Schweikle via Python-list



Am Di., 13.Juni.2023 um 20:36:17 schrieb Mats Wichmann via Python-list:

On 6/13/23 12:12, Thomas Schweikle via Python-list wrote:



Am Di., 13.Juni.2023 um 19:20:38 schrieb Jim Schwartz:

What version of visual studio are you using?


Visual Studio 2022, aka 17.6.2.


What version of python?


python 3.10.11 or 3.11.4

I’ve had success with using the cython package in python and cl from 
visual studio, but I haven’t tried visual studio alone.


Same problem at the same place: directory "../modules/..." not found, 
Renaming it from "Modules" to "modules" it is found, but then fails to 
find "Modules".


Looks like it awaits, compiling in Windows an filesystem only case 
aware, not case sensitive -- I'm assuming this a bug now. Building 
within cygwin (or MSYS, Ubuntu) this works as expected. But there it 
does not search for "modules" once and "Modules" at an other place.


I just did this build the other day for the first time even from a git 
checkout (so VS22, and not a versioned release but top of main branch), 
and there was no such problem - did you follow the instructions at 
https://devguide.python.org/getting-started/setup-building/index.html?


Yes.
Had git installed (2.41.0.windows.1), did "git clone 
https://github.com/python/cpython.git;, then checked out the branch I 
wanted: "git checkout 3.10.12" (or 3.11.4, 3.12.0b2).


Python was already installed and in path:
"python --version" gives back: "Python 3.11.4"

Changed into cpython directory, then called: ".\PCbuild\build.bat" 
(".\pcbuild\build.bat" will, within cmd.exe, throw an error: File not 
found -- remember directory cpython and all beyond are case sensitive, 
not only case aware -- git sets case sensitiveness for checked out 
directories).


It compiles until it does not find "modules", because the directory is 
named "Modules" (all posix file systems behave this way and NTFS can be 
forced to behave this way too. It is easy and any user can do it:


"fsutil.exe file SetCaseSensitiveInfo  enable"

You may query this with:

"fsutil.exe file queryCaseSensitiveInfo "

In my case:
~/Documents/Projekte/cpython> fsutil.exe file queryCaseSensitiveInfo .
Das Attribut für Groß-/Kleinschreibung für das Verzeichnis ^
"C:\Users\user\Documents\Projekte\cpython" ist aktiviert.

Or: the directory we're in is case sensitive and distinguishes between 
"Modules", "modules" and "MODULES" and you can have them all:


C:\Users\user\Documents\Projekte\cpython>dir
 Datenträger in Laufwerk C: ist Windows
 Volumeseriennummer: BC5E-F466

 Verzeichnis von C:\Users\user\Documents\Projekte\cpython

Di, 13.Jun.2023  21:23  .
Di, 13.Jun.2023  21:23  ..
[...]
Di, 13.Jun.2023  21:23  MODULES
Mo, 12.Jun.2023  22:13  Modules
Di, 13.Jun.2023  21:23  modules
[...]
  16 Datei(en),  1.320.340 Bytes
  21 Verzeichnis(se), 134.699.622.400 Bytes frei

Since case sensitivity is necessary for a variety of projects normally 
only used with *nix-OS I've configured git to create directories with 
case sensitivity set enabled (its default meanwhile if git is installed 
on windows).

--
Thomas



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-13 Thread Eryk Sun via Python-list
On 6/13/23, Thomas Schweikle via Python-list  wrote:
>
> Since Git enables Windows NTFS case sensitivity while checking out
> sources ... is it a bug or a "feature"? And: is there a simple

AFAIK the Windows version of Git (you're not using the Linux version
of Git via WSL, right?) does not automatically enable NTFS case
sensitivity. But a newly created directory does inherit the case
sensitivity of its parent directory. Make sure to clone the CPython
repo in a directory that has case sensitivity disabled.

>_testconsole.c
> C:\Users\sct-muc\Documents\Projekte\cpython\PC\_testconsole.c(13,10):
> fatal  error C1083: Datei (Include) kann nicht geöffnet werde
> n: "..\modules\_io\_iomodule.h": No such file or directory
> [C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\_testconsole.vcxpro
> j]

I just built the main branch in a case sensitive tree. I had no
problem building "_testconsole.c". However, building the _decimal
extension module raised a couple of serious warnings. In
"PCbuild/_decimal.vcxproj", there's an include for
"..\Modules\_decimal\libmpdec\vcdiv64.asm". However, MSBuild resolved
this relative path with all lower-case names, i.e. "modules" instead
of the correct name "Modules", and it incorrectly tried to output
"vcdiv64.obj" in a subdirectory of "pcbuild" instead of the correct
name "PCbuild". This appears to be a bug in MSBuild. A lot of Windows
programs don't handle case-sensitive directories well, including
Python's standard library. It's understandable when comparing paths,
but the behavior in this case is inexcusably bad.
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Compiling python on windows with vs

2023-06-13 Thread Jim Schwartz via Python-list
One expert told me to do the following when compiling via cython and cl:

cython -3 --embed -o c_file_namepython_file_name

Then, assuming python is installed in your apps directory and not your program 
files directory:

set "PYTHON_DIR=%LocalAppData%\Programs\Python\Python311" 

or whatever directory you put python in.

cl /O2 /I"%PYTHON_DIR%\Include" c_file_name  /link /libpath:"%PYTHON_DIR%\libs"

If that doesn't work, that's all I have.  Sorry.

-Original Message-
From: Python-list  On 
Behalf Of Thomas Schweikle via Python-list
Sent: Tuesday, June 13, 2023 1:12 PM
To: Python 
Cc: Thomas Schweikle 
Subject: Re: Compiling python on windows with vs



Am Di., 13.Juni.2023 um 19:20:38 schrieb Jim Schwartz:
> What version of visual studio are you using?

Visual Studio 2022, aka 17.6.2.

> What version of python?

python 3.10.11 or 3.11.4

> I’ve had success with using the cython package in python and cl from visual 
> studio, but I haven’t tried visual studio alone.

Same problem at the same place: directory "../modules/..." not found, Renaming 
it from "Modules" to "modules" it is found, but then fails to find "Modules".

Looks like it awaits, compiling in Windows an filesystem only case aware, not 
case sensitive -- I'm assuming this a bug now. Building within cygwin (or MSYS, 
Ubuntu) this works as expected. But there it does not search for "modules" once 
and "Modules" at an other place.

>> On Jun 13, 2023, at 11:59 AM, Thomas Schweikle via Python-list 
>>  wrote:
>>
>> Fehler beim Buildvorgang
--
Thomas


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


Re: Compiling python on windows with vs

2023-06-13 Thread Mats Wichmann via Python-list

On 6/13/23 12:12, Thomas Schweikle via Python-list wrote:



Am Di., 13.Juni.2023 um 19:20:38 schrieb Jim Schwartz:

What version of visual studio are you using?


Visual Studio 2022, aka 17.6.2.


What version of python?


python 3.10.11 or 3.11.4

I’ve had success with using the cython package in python and cl from 
visual studio, but I haven’t tried visual studio alone.


Same problem at the same place: directory "../modules/..." not found, 
Renaming it from "Modules" to "modules" it is found, but then fails to 
find "Modules".


Looks like it awaits, compiling in Windows an filesystem only case 
aware, not case sensitive -- I'm assuming this a bug now. Building 
within cygwin (or MSYS, Ubuntu) this works as expected. But there it 
does not search for "modules" once and "Modules" at an other place.


I just did this build the other day for the first time even from a git 
checkout (so VS22, and not a versioned release but top of main branch), 
and there was no such problem - did you follow the instructions at 
https://devguide.python.org/getting-started/setup-building/index.html?



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


Re: Compiling python on windows with vs

2023-06-13 Thread Thomas Schweikle via Python-list



Am Di., 13.Juni.2023 um 19:20:38 schrieb Jim Schwartz:

What version of visual studio are you using?


Visual Studio 2022, aka 17.6.2.


What version of python?


python 3.10.11 or 3.11.4


I’ve had success with using the cython package in python and cl from visual 
studio, but I haven’t tried visual studio alone.


Same problem at the same place: directory "../modules/..." not found, 
Renaming it from "Modules" to "modules" it is found, but then fails to 
find "Modules".


Looks like it awaits, compiling in Windows an filesystem only case 
aware, not case sensitive -- I'm assuming this a bug now. Building 
within cygwin (or MSYS, Ubuntu) this works as expected. But there it 
does not search for "modules" once and "Modules" at an other place.



On Jun 13, 2023, at 11:59 AM, Thomas Schweikle via Python-list 
 wrote:

Fehler beim Buildvorgang

--
Thomas



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling python on windows with vs

2023-06-13 Thread Jim Schwartz via Python-list
What version of visual studio are you using?  What version of python?  I’ve had 
success with using the cython package in python and cl from visual studio, but 
I haven’t tried visual studio alone. 

Sent from my iPhone

> On Jun 13, 2023, at 11:59 AM, Thomas Schweikle via Python-list 
>  wrote:
> 
> Fehler beim Buildvorgang

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


Compiling python on windows with vs

2023-06-13 Thread Thomas Schweikle via Python-list

Hi!

Trying to compile python on windows leads to following error:

  _testimportmultiple.vcxproj -> 
C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\amd64\_testimportmultiple.pyd

  _testmultiphase.c
 Bibliothek 
"C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\amd64\_testmultiphase.lib" 
und Objekt "C:\Users\sct-muc\Docume

  nts\Projekte\cpython\PCbuild\amd64\_testmultiphase.exp" werden erstellt.
  Code wird generiert.
  Codegenerierung ist abgeschlossen.
  _testmultiphase.vcxproj -> 
C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\amd64\_testmultiphase.pyd

  _testconsole.c
C:\Users\sct-muc\Documents\Projekte\cpython\PC\_testconsole.c(13,10): 
fatal  error C1083: Datei (Include) kann nicht geöffnet werde
n: "..\modules\_io\_iomodule.h": No such file or directory 
[C:\Users\sct-muc\Documents\Projekte\cpython\PCbuild\_testconsole.vcxpro

j]

Fehler beim Buildvorgang.

if I rename "Modules" to "modules" it will find 
"..\modules\_io\_iomodule.h" but wont find "..\Modules\..."


Since Git enables Windows NTFS case sensitivity while checking out 
sources ... is it a bug or a "feature"? And: is there a simple 
workaround available besides disabling case sensitivity (which will 
break others)?

--
Thomas



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-28 Thread Thomas Passin

On 3/28/2023 1:50 PM, a a wrote:

On Tuesday, 28 March 2023 at 18:12:40 UTC+2, Thomas Passin wrote:

On 3/28/2023 8:47 AM, a a wrote:

Ok, I can export bookmarks to html file and open it in Firefox to get
a long list of clickable urls but icon of the bookmarked web page is missing.

When I open Bookmarks as right a side-bar I can view and identify an individual 
Boomarks by icon,
so I would like Firefox Library to export Bookmarks to html file, icons 
included 

Since accessing opened Tabs is my default use of history in Firefox and has 
worked fine for years
I paid no special interest to bookmark opened Tabs and assign labels to 
individual bookmark.

So, generally speaking, I am happy with 1,000+ opened Tabs in Firefox , not 
being sure if this number is for real or refers to every bookmark from the 
history + opened Tabs

But definitely I need a smarter solution and approach to manage 10,000+ opened 
Tabs in Firefox in a future 


I think you had better start using another name for this thread, if it
continues.

The HTML export file will contain the icons, but the HTML elements do
not provide for showing them.

I can't imagine how you can find anything among nor navigate through
1000 open tabs, let alone 10,000 in the future. I would think the memory
usage would be impossibly high. So I hope you are mostly using the
history and do not really have that many tabs open at once!



I am a plain guy, so if Firefox counted 1,000+ opened Tabs, I can be surprised, 
but have no idea how to check that number.

You are exactly right, icon URI and icon data come with saved opened Tabs,
a single example below.

So I am going to ask Firefox team to offer
export to html, modified to have :
icon, name of web page, url address
to appear in a single row (feature already supported by Firefox, when you open 
new Tab
and click: enter URL or search string - input field,
you get such list
List is limited in size for the reasons unknown to me, but feature works fine.


You should be aware that the HTML format for bookmarks is a standard 
developed back in the day by Netscape. It goes back to the early 1990s, 
I think. The FF folks will not be modifying it, since all browsers know 
how to generate it and consume it, and who knows how many software 
packages consume it.  No one can afford to have a change, even one 
that's supposed to be harmless, inadvertently break software that's 
worked for years.


They are going to need a lot of persuading.

Maybe there's something else they would be willing and able to do.  But 
you can expect that any proposed new feature will probably need to have 
some strong support.  Raymond Chen at Microsoft has written how each new 
feature proposal starts off with -100 points.  Only if the advantages 
get the score up above zero can the feature have any chance of getting 
adopted - and then it has to compete with other potential features that 
have their own scores.




--
So would prefer a horizontal list of opened Tabs
by htmlized, vertical list of the same opened Tabs,
featuring:
icon, name of web-site, URL address

Thank you for your excellent support


You're welcome.

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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-28 Thread a a
On Tuesday, 28 March 2023 at 18:12:40 UTC+2, Thomas Passin wrote:
> On 3/28/2023 8:47 AM, a a wrote: 
> > Ok, I can export bookmarks to html file and open it in Firefox to get 
> > a long list of clickable urls but icon of the bookmarked web page is 
> > missing. 
> > 
> > When I open Bookmarks as right a side-bar I can view and identify an 
> > individual Boomarks by icon,
> > so I would like Firefox Library to export Bookmarks to html file, icons 
> > included 
> > 
> > Since accessing opened Tabs is my default use of history in Firefox and has 
> > worked fine for years 
> > I paid no special interest to bookmark opened Tabs and assign labels to 
> > individual bookmark. 
> > 
> > So, generally speaking, I am happy with 1,000+ opened Tabs in Firefox , not 
> > being sure if this number is for real or refers to every bookmark from the 
> > history + opened Tabs 
> >
> > But definitely I need a smarter solution and approach to manage 10,000+ 
> > opened Tabs in Firefox in a future  
> 
> I think you had better start using another name for this thread, if it 
> continues. 
> 
> The HTML export file will contain the icons, but the HTML elements do 
> not provide for showing them. 
> 
> I can't imagine how you can find anything among nor navigate through 
> 1000 open tabs, let alone 10,000 in the future. I would think the memory 
> usage would be impossibly high. So I hope you are mostly using the 
> history and do not really have that many tabs open at once!


I am a plain guy, so if Firefox counted 1,000+ opened Tabs, I can be surprised, 
but have no idea how to check that number.

You are exactly right, icon URI and icon data come with saved opened Tabs,
a single example below.

So I am going to ask Firefox team to offer
export to html, modified to have :
icon, name of web page, url address
to appear in a single row (feature already supported by Firefox, when you open 
new Tab
and click: enter URL or search string - input field,
you get such list
List is limited in size for the reasons unknown to me, but feature works fine.

--
So would prefer a horizontal list of opened Tabs
by htmlized, vertical list of the same opened Tabs,
featuring:
icon, name of web-site, URL address

Thank you for your excellent support

darius


"https://www.nasa.gov/feature/goddard/2017/nasas-sdo-watches-a-sunspot-turn-toward-earth;
 add_date="1499899506" last_modified="1499899507" 
icon_uri="https://www.nasa.gov/favicon.ico; 

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-28 Thread Thomas Passin

On 3/28/2023 8:47 AM, a a wrote:

Ok, I can export bookmarks to html file and open it in Firefox to get
a long list of clickable urls but icon of the bookmarked web page is missing.

When I open Bookmarks as right a side-bar I can view and identify an individual 
Boomarks by icon,
so I would like Firefox Library to export Bookmarks to html file, icons 
included 

Since accessing opened Tabs is my default use of history in Firefox and has 
worked fine for years
I paid no special interest to bookmark opened Tabs and assign labels to 
individual bookmark.

So, generally speaking, I am happy with 1,000+ opened Tabs in Firefox , not 
being sure if this number is for real or refers to every bookmark from the 
history + opened Tabs

But definitely I need a smarter solution and approach to manage 10,000+ opened 
Tabs in Firefox in a future 


I think you had better start using another name for this thread, if it 
continues.


The HTML export file will contain the icons, but the HTML elements do 
not provide for showing them.


I can't imagine how you can find anything among nor navigate through 
1000 open tabs, let alone 10,000 in the future. I would think the memory 
usage would be impossibly high.  So I hope you are mostly using the 
history and do not really have that many tabs open at once!


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-28 Thread a a
On Tuesday, 28 March 2023 at 06:33:44 UTC+2, Thomas Passin wrote:
> On 3/27/2023 8:37 PM, a a wrote: 
> >> To save the tabs, right click any one of them and select the "Select All 
> >> Tabs" item. They will all highlight. Right click on one of them and 
> >> select the "Bookmark Tabs" item. A dialog box will open with an entry 
> >> lone for the Name to use (like "Tabset1") and a location - a bookmark 
> >> folder - for them to go into. CAREFUL - if you just click "Save", you 
> >> may not be able to find them. Use the dropdown arrow to save them in 
> >> one of the top level folders, like "Bookmarks Toolbars". 
> > I can select All Opened Tabs (as from the given link) 
> > and get 1,000+ Opened Tabs ( I am afraid, this is s number of all saved 
> > bookmarks in the past) 
> > I go to menu, Bookmarks, Manage Boomarks and copy Tabs 
> > 
> > and 
> > https://www.textfixer.com/html/convert-url-to-html-link.php 
> > 
> > does the job, converting text urls into clickable web links 
> > 
> > I copy the result and past into Notepad++ to save file as html 
> > 
> > and what I get is web page of clickable Opened Tabs 
> > 
> > since icon and page name are lost
> I don't understand this. You don't really have 1000 tabs open at the 
> same time, do you? If you select all the open tabs - I think you wrote 
> that you only have 50 - then you can save them as bookmarks under a 
> folder name you choose. That folder will contain the 50 open links. I 
> tried it this evening, so I know that's how it works. (It happens that 
> I'm working on my own bookmark manager just now, so I've been messing 
> around with importing, exporting, and reading the bookmark files). 
> 
> Then you can export them and import the same bookmark file into another 
> browser on another computer. Whenever you want to reopen some of those 
> tabs, you would navigate to that part of the bookmarks and open the tabs 
> you want. 
> 
> Maybe you have something else in mind? Do you want to send the links of 
> the opened tab set to someone else, but not all your bookmarks? Please 
> explain more carefully what you want to do.

Ok, I can export bookmarks to html file and open it in Firefox to get
a long list of clickable urls but icon of the bookmarked web page is missing.

When I open Bookmarks as right a side-bar I can view and identify an individual 
Boomarks by icon,
so I would like Firefox Library to export Bookmarks to html file, icons 
included ;)

Since accessing opened Tabs is my default use of history in Firefox and has 
worked fine for years
I paid no special interest to bookmark opened Tabs and assign labels to 
individual bookmark.

So, generally speaking, I am happy with 1,000+ opened Tabs in Firefox , not 
being sure if this number is for real or refers to every bookmark from the 
history + opened Tabs

But definitely I need a smarter solution and approach to manage 10,000+ opened 
Tabs in Firefox in a future ;)

- I just build personal search engine resembling targets set by MyLifeBits 
Project by Microsoft in the past.

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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-28 Thread a a
On Tuesday, 28 March 2023 at 06:33:44 UTC+2, Thomas Passin wrote:
> On 3/27/2023 8:37 PM, a a wrote: 
> >> To save the tabs, right click any one of them and select the "Select All 
> >> Tabs" item. They will all highlight. Right click on one of them and 
> >> select the "Bookmark Tabs" item. A dialog box will open with an entry 
> >> lone for the Name to use (like "Tabset1") and a location - a bookmark 
> >> folder - for them to go into. CAREFUL - if you just click "Save", you 
> >> may not be able to find them. Use the dropdown arrow to save them in 
> >> one of the top level folders, like "Bookmarks Toolbars". 
> > I can select All Opened Tabs (as from the given link) 
> > and get 1,000+ Opened Tabs ( I am afraid, this is s number of all saved 
> > bookmarks in the past) 
> > I go to menu, Bookmarks, Manage Boomarks and copy Tabs 
> > 
> > and 
> > https://www.textfixer.com/html/convert-url-to-html-link.php 
> > 
> > does the job, converting text urls into clickable web links 
> > 
> > I copy the result and past into Notepad++ to save file as html 
> > 
> > and what I get is web page of clickable Opened Tabs 
> > 
> > since icon and page name are lost
> I don't understand this. You don't really have 1000 tabs open at the 
> same time, do you? If you select all the open tabs - I think you wrote 
> that you only have 50 - then you can save them as bookmarks under a 
> folder name you choose. That folder will contain the 50 open links. I 
> tried it this evening, so I know that's how it works. (It happens that 
> I'm working on my own bookmark manager just now, so I've been messing 
> around with importing, exporting, and reading the bookmark files). 
> 
> Then you can export them and import the same bookmark file into another 
> browser on another computer. Whenever you want to reopen some of those 
> tabs, you would navigate to that part of the bookmarks and open the tabs 
> you want. 
> 
> Maybe you have something else in mind? Do you want to send the links of 
> the opened tab set to someone else, but not all your bookmarks? Please 
> explain more carefully what you want to do.

Ok, I was not aware of the real number of the opened Tabs in Firefox, since I 
can jump from left to right and vice versa in real time, so the number given by 
me: 50 opened Tabs was my general estimate, but I can read the real number of 
opened Tabs from the same menu (line below) to be 1,000+

What I copy and paste into Notepad++ is 1,000+ -line file.
It's hard to verify if the above number is made of opened Tabs only or 
bookmarks are included, 
since I exactly use and keep multi Tabs opened as my live bookmarks and cache 
memory, when I work on my projects (watching, counting sunspots,   Earthquakes 
prediction in Turkey, ... )

I would like to fund the development of such smart Tabs Manager to replace 
boomarks, to let me group Tabs belonging to different projects.

It doesn't look to be complicated, if supported by the Firefox team.

Firefox 97. comes with alike functionality (when I open a new Tab)  but limited 
to 4 rows of web-page icons + names and 4 rows called: Recent activity

All I need is to replace opened Tabs by history of the Recent activity - 
default Firefox page, when I open a new Tab

It's hard to imagine, I can have 1,000+ Tabs live opened in Firefox
but I really need such feature, called in the past as: MyLifeBits by MS

So I have to ask Firefox team today  to lift 4 rows limit on web links and 4 
rows limit on the recent activity, coming with
New Tab opened


When I am busy on a project I can open 100+ web pages via search engine  in one 
day and would prefer
100+ opened Tabs to be saved in html format for the records as a reference.

Hope to get some support from Firefox team via Twitter.

Ok, smart bookmarks manager can offer the above functionality right now, so I 
go to search engine to get one.

darius

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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin

On 3/27/2023 8:37 PM, a a wrote:

I can select All Opened Tabs (as from the given link)
and get 1,000+ Opened Tabs ( I am afraid, this is s number of all saved 
bookmarks in the past)
I go to menu, Bookmarks, Manage Boomarks and copy Tabs

and
https://www.textfixer.com/html/convert-url-to-html-link.php

does the job, converting text urls into clickable web links

I copy the result and past into Notepad++ to save file as html

and what I get is web page of clickable Opened Tabs
You can get that directly in Notepad++.  Load Firefox's HTML format 
bookmark file into Notepad++. View it in a browser using the "View/View 
Current File In" menu item. True, you could have opened it directly in 
the browser, but now you can edit the file and cut out the parts you 
don't need, and check to make sure you get what you intended. The 
structure of the HTML is very regular.


If you have saved your set of opened links under a distinctive heading 
near the top of the collection - as I suggested earlier - it should be 
easy to find the start and end points of their HTML elements, and delete 
all the ones you don't want. You could import this shortened bookmark 
file into another installation of Firefox and this would add them to the 
bookmarks in the other browser, all grouped by your custom heading.


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin

On 3/27/2023 8:37 PM, a a wrote:

To save the tabs, right click any one of them and select the "Select All
Tabs" item. They will all highlight. Right click on one of them and
select the "Bookmark Tabs" item. A dialog box will open with an entry
lone for the Name to use (like "Tabset1") and a location - a bookmark
folder - for them to go into. CAREFUL - if you just click "Save", you
may not be able to find them. Use the dropdown arrow to save them in
one of the top level folders, like "Bookmarks Toolbars".

I can select All Opened Tabs (as from the given link)
and get 1,000+ Opened Tabs ( I am afraid, this is s number of all saved 
bookmarks in the past)
I go to menu, Bookmarks, Manage Boomarks and copy Tabs

and
https://www.textfixer.com/html/convert-url-to-html-link.php

does the job, converting text urls into clickable web links

I copy the result and past into Notepad++ to save file as html

and what I get is web page of clickable Opened Tabs

since icon and page name are lost


I don't understand this. You don't really have 1000 tabs open at the 
same time, do you?  If you select all the open tabs - I think you wrote 
that you only have 50 - then you can save them as bookmarks under a 
folder name you choose. That folder will contain the 50 open links. I 
tried it this evening, so I know that's how it works. (It happens that 
I'm working on my own bookmark manager just now, so I've been messing 
around with importing, exporting, and reading the bookmark files).


Then you can export them and import the same bookmark file into another 
browser on another computer.  Whenever you want to reopen some of those 
tabs, you would navigate to that part of the bookmarks and open the tabs 
you want.


Maybe you have something else in mind?  Do you want to send the links of 
the opened tab set to someone else, but not all your bookmarks? Please 
explain more carefully what you want to do.


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread a a
On Tuesday, 28 March 2023 at 02:07:43 UTC+2, Thomas Passin wrote:
> On 3/27/2023 4:02 PM, Thomas Passin wrote:
> > On 3/27/2023 3:07 PM, a a wrote: 
> >> On Monday, 27 March 2023 at 19:19:41 UTC+2, Thomas Passin wrote: 
> >>> On 3/27/2023 10:07 AM, a a wrote: 
>  Ok, I know, I need to switch to Windows 10 run on another PC next to 
>  me. 
>  
>  I need to learn how to copy and move every web page opened in 
>  Firefox as a reference to social media, web sites for Python, chat 
>  and more (about 50 web pages live opened  
> >>> 
> >>> This sounds like you mean when you get a new Windows 10 PC, you will 
> >>> want to move your open tabs to the new machine. I see several 
> >>> possibilities for this. 
> >>> 
> >>> 1. Copy your Firefox profile folder to the new computer, and tell 
> >>> Firefox to use it as the default profile. I *think* this will include 
> >>> the open tabs, but I haven't tried it. Saving that folder is useful for 
> >>> backup anyway. (If you use Thunderbird for email, you really *must* 
> >>> back up its profile folder because all your email with its folder 
> >>> structure is there. BTW, you can even copy the profile over to a Linux 
> >>> machine that has Thunderbird, and presto, all your email will be there. 
> >>> The Firefox profile would probably transfer just as well). 
> >>> 
> >>> 2. Bookmark all your open tabs under a new heading "open tabs", then 
> >>> export the bookmarks. In the new machine, import them into Firefox 
> >>> there. They won't open in tabs, but it will be easy to find them and 
> >>> open them when you want to. You probably will want to copy over your 
> >>> bookmarks anyway, so this adds little effort. 
> >>> 
> >>> 3. There may be a specific record of open tabs that you can copy or 
> >>> export. I don't know about this but an internet search should help. 
> >>> 
> >>> Good luck. 
> >> 
> >> a nice solution comes from 
> >> 
> >> How to Copy URLs of All Open Tabs in Firefox 
> >> 
> >> https://www.howtogeek.com/723921/how-to-copy-urls-of-all-open-tabs-in-firefox/
> >>  
> >> 
> >> right clicking opened tab, all opened tabs can be selected 
> >> moving via menu to bookmarks/ booksmarks management 
> >> url bookmarks can be right-mouse clicked to copy urls 
> >> finally, urls can be pasted into Notepad++ 
> >> and saved as a file 
> >> unfortunately, saving as .html file 
> >> fails to generate html file with clickable web links 
> >> 
> >
> > Don't go pasting urls into a text file one by one.  Instead, do my #2 
> > above. That will import all the bookmarks, including the tabs you saved 
> > as bookmarks.  Then import the exported bookmark file into the new 
> > browser.  There's no reason to fuss around trying to get text copies of 
> > urls to open. 
> > 
> > For that matter, the exported bookmarks file is an HTML file and can be 
> > opened directly in a browser, with clickable links.
> All right, I think I've got the easiest way to go. You *can* bookmark 
> all the tabs at once - see below. Then, as I already proposed, export 
> the bookmarks and import them into Firefox on the new computer. 
> 
> To save the tabs, right click any one of them and select the "Select All 
> Tabs" item. They will all highlight. Right click on one of them and 
> select the "Bookmark Tabs" item. A dialog box will open with an entry 
> lone for the Name to use (like "Tabset1") and a location - a bookmark 
> folder - for them to go into. CAREFUL - if you just click "Save", you 
> may not be able to find them. Use the dropdown arrow to save them in 
> one of the top level folders, like "Bookmarks Toolbars".

I can select All Opened Tabs (as from the given link)
and get 1,000+ Opened Tabs ( I am afraid, this is s number of all saved 
bookmarks in the past)
I go to menu, Bookmarks, Manage Boomarks and copy Tabs

and 
https://www.textfixer.com/html/convert-url-to-html-link.php

does the job, converting text urls into clickable web links

I copy the result and past into Notepad++ to save file as html

and what I get is web page of clickable Opened Tabs

since icon and page name are lost 
I would prefer another solution already ofered by Firex to generate web page of 
recently visited web pages,
unfortunately coming with  limits on the number of visited
web pages,
so I contacted Firefox, Notepad++ for help
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin

On 3/27/2023 4:02 PM, Thomas Passin wrote:

On 3/27/2023 3:07 PM, a a wrote:

On Monday, 27 March 2023 at 19:19:41 UTC+2, Thomas Passin wrote:

On 3/27/2023 10:07 AM, a a wrote:
Ok, I know, I need to switch to Windows 10 run on another PC next to 
me.


I need to learn how to copy and move every web page opened in 
Firefox as a reference to social media, web sites for Python, chat 
and more (about 50 web pages live opened 


This sounds like you mean when you get a new Windows 10 PC, you will
want to move your open tabs to the new machine. I see several
possibilities for this.

1. Copy your Firefox profile folder to the new computer, and tell
Firefox to use it as the default profile. I *think* this will include
the open tabs, but I haven't tried it. Saving that folder is useful for
backup anyway. (If you use Thunderbird for email, you really *must*
back up its profile folder because all your email with its folder
structure is there. BTW, you can even copy the profile over to a Linux
machine that has Thunderbird, and presto, all your email will be there.
The Firefox profile would probably transfer just as well).

2. Bookmark all your open tabs under a new heading "open tabs", then
export the bookmarks. In the new machine, import them into Firefox
there. They won't open in tabs, but it will be easy to find them and
open them when you want to. You probably will want to copy over your
bookmarks anyway, so this adds little effort.

3. There may be a specific record of open tabs that you can copy or
export. I don't know about this but an internet search should help.

Good luck.


a nice solution comes from

How to Copy URLs of All Open Tabs in Firefox

https://www.howtogeek.com/723921/how-to-copy-urls-of-all-open-tabs-in-firefox/

right clicking opened tab, all opened tabs can be selected
moving via menu to bookmarks/ booksmarks management
url bookmarks can be right-mouse clicked to copy urls
finally, urls can be pasted into Notepad++
and saved as a file
unfortunately, saving as .html file
fails to generate html file with clickable web links



Don't go pasting urls into a text file one by one.  Instead, do my #2 
above. That will import all the bookmarks, including the tabs you saved 
as bookmarks.  Then import the exported bookmark file into the new 
browser.  There's no reason to fuss around trying to get text copies of 
urls to open.


For that matter, the exported bookmarks file is an HTML file and can be 
opened directly in a browser, with clickable links.


All right, I think I've got the easiest way to go.  You *can* bookmark 
all the tabs at once - see below.  Then, as I already proposed, export 
the bookmarks and import them into Firefox on the new computer.


To save the tabs, right click any one of them and select the "Select All 
Tabs" item.  They will all highlight.  Right click on one of them and 
select the "Bookmark Tabs" item. A dialog box will open with an entry 
lone for the Name to use (like "Tabset1") and a location - a bookmark 
folder - for them to go into.  CAREFUL - if you just click "Save", you 
may not be able to find them.  Use the dropdown arrow to save them in 
one of the top level folders, like "Bookmarks Toolbars".


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin

On 3/27/2023 3:07 PM, a a wrote:

On Monday, 27 March 2023 at 19:19:41 UTC+2, Thomas Passin wrote:

On 3/27/2023 10:07 AM, a a wrote:

Ok, I know, I need to switch to Windows 10 run on another PC next to me.

I need to learn how to copy and move every web page opened in Firefox as a 
reference to social media, web sites for Python, chat and more (about 50 web 
pages live opened 


This sounds like you mean when you get a new Windows 10 PC, you will
want to move your open tabs to the new machine. I see several
possibilities for this.

1. Copy your Firefox profile folder to the new computer, and tell
Firefox to use it as the default profile. I *think* this will include
the open tabs, but I haven't tried it. Saving that folder is useful for
backup anyway. (If you use Thunderbird for email, you really *must*
back up its profile folder because all your email with its folder
structure is there. BTW, you can even copy the profile over to a Linux
machine that has Thunderbird, and presto, all your email will be there.
The Firefox profile would probably transfer just as well).

2. Bookmark all your open tabs under a new heading "open tabs", then
export the bookmarks. In the new machine, import them into Firefox
there. They won't open in tabs, but it will be easy to find them and
open them when you want to. You probably will want to copy over your
bookmarks anyway, so this adds little effort.

3. There may be a specific record of open tabs that you can copy or
export. I don't know about this but an internet search should help.

Good luck.


a nice solution comes from

How to Copy URLs of All Open Tabs in Firefox

https://www.howtogeek.com/723921/how-to-copy-urls-of-all-open-tabs-in-firefox/

right clicking opened tab, all opened tabs can be selected
moving via menu to bookmarks/ booksmarks management
url bookmarks can be right-mouse clicked to copy urls
finally, urls can be pasted into Notepad++
and saved as a file
unfortunately, saving as .html file
fails to generate html file with clickable web links



Don't go pasting urls into a text file one by one.  Instead, do my #2 
above. That will import all the bookmarks, including the tabs you saved 
as bookmarks.  Then import the exported bookmark file into the new 
browser.  There's no reason to fuss around trying to get text copies of 
urls to open.


For that matter, the exported bookmarks file is an HTML file and can be 
opened directly in a browser, with clickable links.


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread a a
On Monday, 27 March 2023 at 19:19:41 UTC+2, Thomas Passin wrote:
> On 3/27/2023 10:07 AM, a a wrote: 
> > Ok, I know, I need to switch to Windows 10 run on another PC next to me. 
> >
> > I need to learn how to copy and move every web page opened in Firefox as a 
> > reference to social media, web sites for Python, chat and more (about 50 
> > web pages live opened  
> 
> This sounds like you mean when you get a new Windows 10 PC, you will 
> want to move your open tabs to the new machine. I see several 
> possibilities for this. 
> 
> 1. Copy your Firefox profile folder to the new computer, and tell 
> Firefox to use it as the default profile. I *think* this will include 
> the open tabs, but I haven't tried it. Saving that folder is useful for 
> backup anyway. (If you use Thunderbird for email, you really *must* 
> back up its profile folder because all your email with its folder 
> structure is there. BTW, you can even copy the profile over to a Linux 
> machine that has Thunderbird, and presto, all your email will be there. 
> The Firefox profile would probably transfer just as well). 
> 
> 2. Bookmark all your open tabs under a new heading "open tabs", then 
> export the bookmarks. In the new machine, import them into Firefox 
> there. They won't open in tabs, but it will be easy to find them and 
> open them when you want to. You probably will want to copy over your 
> bookmarks anyway, so this adds little effort. 
> 
> 3. There may be a specific record of open tabs that you can copy or 
> export. I don't know about this but an internet search should help. 
> 
> Good luck.

a nice solution comes from

How to Copy URLs of All Open Tabs in Firefox

https://www.howtogeek.com/723921/how-to-copy-urls-of-all-open-tabs-in-firefox/

right clicking opened tab, all opened tabs can be selected
moving via menu to bookmarks/ booksmarks management 
url bookmarks can be right-mouse clicked to copy urls
finally, urls can be pasted into Notepad++
and saved as a file
unfortunately, saving as .html file
fails to generate html file with clickable web links

Notepad++ keeps urls active, selectable but not ready to be opened in Firefox

so I need to learn how to make Notepad++ or another editor to save urls as
html file

BTW

Selecting all opened tabs I get 1,000+ active urls (opened web pages ), so 
something must be wrong
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin

On 3/27/2023 10:07 AM, a a wrote:

Ok, I know, I need to switch to Windows 10 run on another PC next to me.

I need to learn how to copy and move every web page opened in Firefox as a 
reference to social media, web sites for Python, chat and more (about 50 web 
pages live opened 


This sounds like you mean when you get a new Windows 10 PC, you will 
want to move your open tabs to the new machine.  I see several 
possibilities for this.


1. Copy your Firefox profile folder to the new computer, and tell 
Firefox to use it as the default profile.  I *think* this will include 
the open tabs, but I haven't tried it.  Saving that folder is useful for 
backup anyway.  (If you use Thunderbird for email, you really *must* 
back up its profile folder because all your email with its folder 
structure is there. BTW, you can even copy the profile over to a Linux 
machine that has Thunderbird, and presto, all your email will be there. 
The Firefox profile would probably transfer just as well).


2. Bookmark all your open tabs under a new heading "open tabs", then 
export the bookmarks. In the new machine, import them into Firefox 
there.  They won't open in tabs, but it will be easy to find them and 
open them when you want to.  You probably will want to copy over your 
bookmarks anyway, so this adds little effort.


3. There may be a specific record of open tabs that you can copy or 
export.  I don't know about this but an internet search should help.


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread a a
On Thursday, 23 March 2023 at 22:15:10 UTC+1, Thomas Passin wrote:
> On 3/23/2023 3:38 PM, Mats Wichmann wrote: 
> > On 3/23/23 09:48, Thomas Passin wrote: 
> > 
> >> I didn't realize that Christoph Gohlke is still maintaining this site. 
> > 
> > Unless the the last-changed stuff stopped working, it's in a static state: 
> > 
> > by Christoph Gohlke. Updated on 26 June 2022 at 07:27 UTC
> I did see that. The OP needs a version that would work with Windows 7 
> and an older version of Python (3.7 or 3.8, IIRC), so things may work out.
Thank you Thomas for your excellent work you did for me.

Ok, I know, I need to switch to Windows 10 run on another PC next to me.

I need to learn how to copy and move every web page opened in Firefox as a 
reference to social media, web sites for Python, chat and more (about 50 web 
pages live opened ;)

I really love the limited functionality of w3schools to let me live open and 
run Python examples, especiallly Matplotlib examples.

Unfortunately chat forum at w3schools is low traffic, showing no interest to 
add more examples.


https://www.w3schools.com/python/trypython.asp?filename=demo_matplotlib_subplots3

https://www.w3schools.com/python/matplotlib_subplot.asp

thank you Thomas,

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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-23 Thread Thomas Passin

On 3/23/2023 3:38 PM, Mats Wichmann wrote:

On 3/23/23 09:48, Thomas Passin wrote:

I didn't realize that Christoph Gohlke is still maintaining this site. 


Unless the the last-changed stuff stopped working, it's in a static state:

by Christoph Gohlke. Updated on 26 June 2022 at 07:27 UTC


I did see that.  The OP needs a version that would work with Windows 7 
and an older version of Python (3.7 or 3.8, IIRC), so things may work out.


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-23 Thread Mats Wichmann

On 3/23/23 09:48, Thomas Passin wrote:

I didn't realize that Christoph Gohlke is still maintaining this site. 


Unless the the last-changed stuff stopped working, it's in a static state:

by Christoph Gohlke. Updated on 26 June 2022 at 07:27 UTC



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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-23 Thread Thomas Passin

On 3/18/2023 3:05 PM, Thomas Passin wrote:

downloaded and run HWiNFO and AVE not supported, not greened out


That's too bad; you may be out of luck.  It's possible that someone
has compiled the .pyd library in such a way that it does not need the
 instruction set extensions.  I'm sorry but I don't know how to find
out except by trying internet searches - or by downgrading to earlier
 versions of Numpy hoping to find one that works and also can be used
by the other libraries/programs that need to use it.


Here's a possibility to try -

https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

"NumPy: a fundamental package needed for scientific computing with Python.

Numpy+MKL is linked to the Intel® Math Kernel Library and includes
required DLLs in the numpy.DLLs directory.

Numpy+Vanilla is a minimal distribution, which does not include any
optimized BLAS libray or C runtime DLLs."

I didn't realize that Christoph Gohlke is still maintaining this site. I 
haven't needed to use it since PyPi got so much more complete about 
packages with binary code. He has tons of binary packages for all kinds 
of Python libraries.  I think this one might work for you because it 
links to the Intel math library. So it may be able to use various or no 
instruction set extensions. If so, it could work with your old processor.


Worth trying, anyway.

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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-22 Thread Thomas Passin

On 3/22/2023 8:09 AM, a a wrote:

On Saturday, 18 March 2023 at 20:12:22 UTC+1, Thomas Passin wrote:

On 3/17/2023 11:52 AM, a a wrote:

On Friday, 17 March 2023 at 16:32:53 UTC+1, a a wrote:

On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote:

On 3/16/2023 8:07 PM, a a wrote:

Crash report:

Problem Caption:
Problem Event Name: APPCRASH
Application name: python.exe
Application version: 3.8.7150.1013
Application time signature: 5fe0df5a
Error module name: _multiarray_umath.cp38-win32.pyd
Version of the module with the error: 0.0.0.0
Time signature of the module with the error: 63dfe4cf
Exception code: c01d
Exception offset: 000269c9
Operating system version: 6.1.7601.2.1.0.256.48
Regional Settings ID: 1045
Additional information 1: 0a9e
Additional information 2: 0a9e372d3b4ad19135b953a78882e789
Additional information 3: 0a9e
Additional information 4: 0a9e372d3b4ad19135b953a78882e789

This exception has been reported to have many causes, but one
possibility seems to be that your computer may not support an advanced
instruction set that the .pyd was compiled for. I found this one
specifically mentioned on the Internet: Advanced Vector Extensions. If
that were the case, you would either need to find a different version of
the module, or upgrade the computer/OS.

It would be worth trying to downgrade the multiarray version to an
earlier one and see if that fixes the problem.

Thank you Thomas
for your kind reply.

I am fully aware to be living on an old machine, old OS, Windows 7, 32-bit 
system
but I have visited every social chat support forum on the Internet: from Python 
to Matplotlib, Numpy, Twitter, Github.

As a newbie I am not aware how to downgrade "the multiarray version to an
earlier one

I simply tried to test Python code from


https://www.section.io/engineering-education/reading-and-processing-android-sensor-data-using-python-with-csv-read/


# Python program to read .csv file

import numpy as np
import matplotlib.pyplot as plt
import csv


"After importing the libraries, we now read the .csv file:

with open('accl1.csv', 'r') as f:
data = list(csv.reader(f, delimiter=',')) #reading csv file


Just read about AVE from Wikipedia

https://en.wikipedia.org/wiki/Advanced_Vector_Extensions



downloaded and run
HWiNFO
and AVE not supported, not greened out

That's too bad; you may be out of luck. It's possible that someone has
compiled the .pyd library in such a way that it does not need the
instruction set extensions. I'm sorry but I don't know how to find out
except by trying internet searches - or by downgrading to earlier
versions of Numpy hoping to find one that works and also can be used by
the other libraries/programs that need to use it.



Thank you Thomas for youre kind help.

You are the real Python PRO, you deserve Nobel Prize in Python.

:)


I operated an old Dell computer with Windows XP preinstalled
and upgraded XP to Windows 7 to get some web services to work.

Unfortunately I failed to find and install driver for video controller since 
none supported by Dell.

Visited many driver sites (Intel Driver Assistant included and more)
without any success.

So life with an old PC is not easy


I reused my 10-year-old Sony VAIO laptop (it had Windows 8, IIRC) to be 
a Linux machine - I got a 1T external solid state drive, set up the BIOS 
to boot from it, and installed Linux Mint.  If you are willing to tackle 
Linux, this might be a good way to go.  I recommend Mint for newcomers 
to Linux.  The computer is much snappier and pleasant to use than it was 
under Windows.


I mostly use it as a backup computer.  I had to to without my main 
computer for a week or so, and the old machine made a fine substitute. 
I even copied all my Thunderbird emails over and used email all the week 
without losing any messages. Actually, the keyboard on that old computer 
is much better than I've got on my new one, although a few keys are 
getting a little flaky.


I was able to compile some version of Python on it, though I forget why 
I needed to do that.  With this setup, you could install a newer version 
of Python, and Numpy would work - it might get compiled during 
installation, but that's not a problem.  It happens automatically.


If fact, I know that it works because I have Numpy working on the 
computer.  Of course, my computer has the instruction set extensions and 
your does not, so who knows if can be compiled for you.  But it would 
probably be your best bet.


Anyway, if you decide to try it out, let us know.  And if you hit any 
problems, I might be able to help you.  I'm not a Linux expert but I've 
installed various distributions maybe 20 times or more as virtual 
machines, and twice using an external drive, including running Tomcat 
and MySQL as services.  Once you get it installed and working, and 
learned some of its quirks (not too bad, mostly about installing 
programs and configuring the desktop to be more to your liking), it's 
not much different from 

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-22 Thread a a
On Saturday, 18 March 2023 at 20:12:22 UTC+1, Thomas Passin wrote:
> On 3/17/2023 11:52 AM, a a wrote: 
> > On Friday, 17 March 2023 at 16:32:53 UTC+1, a a wrote: 
> >> On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote: 
> >>> On 3/16/2023 8:07 PM, a a wrote: 
>  Crash report: 
>  
>  Problem Caption: 
>  Problem Event Name: APPCRASH 
>  Application name: python.exe 
>  Application version: 3.8.7150.1013 
>  Application time signature: 5fe0df5a 
>  Error module name: _multiarray_umath.cp38-win32.pyd 
>  Version of the module with the error: 0.0.0.0 
>  Time signature of the module with the error: 63dfe4cf 
>  Exception code: c01d 
>  Exception offset: 000269c9 
>  Operating system version: 6.1.7601.2.1.0.256.48 
>  Regional Settings ID: 1045 
>  Additional information 1: 0a9e 
>  Additional information 2: 0a9e372d3b4ad19135b953a78882e789 
>  Additional information 3: 0a9e 
>  Additional information 4: 0a9e372d3b4ad19135b953a78882e789 
> >>> This exception has been reported to have many causes, but one 
> >>> possibility seems to be that your computer may not support an advanced 
> >>> instruction set that the .pyd was compiled for. I found this one 
> >>> specifically mentioned on the Internet: Advanced Vector Extensions. If 
> >>> that were the case, you would either need to find a different version of 
> >>> the module, or upgrade the computer/OS. 
> >>> 
> >>> It would be worth trying to downgrade the multiarray version to an 
> >>> earlier one and see if that fixes the problem. 
> >> Thank you Thomas 
> >> for your kind reply. 
> >> 
> >> I am fully aware to be living on an old machine, old OS, Windows 7, 32-bit 
> >> system 
> >> but I have visited every social chat support forum on the Internet: from 
> >> Python to Matplotlib, Numpy, Twitter, Github. 
> >> 
> >> As a newbie I am not aware how to downgrade "the multiarray version to an 
> >> earlier one 
> >> 
> >> I simply tried to test Python code from 
> >> 
> >> 
> >> https://www.section.io/engineering-education/reading-and-processing-android-sensor-data-using-python-with-csv-read/
> >>  
> >> 
> >>  
> >> # Python program to read .csv file 
> >> 
> >> import numpy as np 
> >> import matplotlib.pyplot as plt 
> >> import csv 
> >>  
> >> 
> >> "After importing the libraries, we now read the .csv file: 
> >> 
> >> with open('accl1.csv', 'r') as f: 
> >> data = list(csv.reader(f, delimiter=',')) #reading csv file 
> >> 
> >>  
> >> Just read about AVE from Wikipedia 
> >> 
> >> https://en.wikipedia.org/wiki/Advanced_Vector_Extensions 
> > 
> > 
> > downloaded and run 
> > HWiNFO 
> > and AVE not supported, not greened out
> That's too bad; you may be out of luck. It's possible that someone has 
> compiled the .pyd library in such a way that it does not need the 
> instruction set extensions. I'm sorry but I don't know how to find out 
> except by trying internet searches - or by downgrading to earlier 
> versions of Numpy hoping to find one that works and also can be used by 
> the other libraries/programs that need to use it.


Thank you Thomas for youre kind help.

You are the real Python PRO, you deserve Nobel Prize in Python.

I operated an old Dell computer with Windows XP preinstalled
and upgraded XP to Windows 7 to get some web services to work.

Unfortunately I failed to find and install driver for video controller since 
none supported by Dell.

Visited many driver sites (Intel Driver Assistant included and more)
without any success.

So life with an old PC is not easy



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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-18 Thread Thomas Passin

On 3/17/2023 11:52 AM, a a wrote:

On Friday, 17 March 2023 at 16:32:53 UTC+1, a a wrote:

On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote:

On 3/16/2023 8:07 PM, a a wrote:

Crash report:

Problem Caption:
Problem Event Name: APPCRASH
Application name: python.exe
Application version: 3.8.7150.1013
Application time signature: 5fe0df5a
Error module name: _multiarray_umath.cp38-win32.pyd
Version of the module with the error: 0.0.0.0
Time signature of the module with the error: 63dfe4cf
Exception code: c01d
Exception offset: 000269c9
Operating system version: 6.1.7601.2.1.0.256.48
Regional Settings ID: 1045
Additional information 1: 0a9e
Additional information 2: 0a9e372d3b4ad19135b953a78882e789
Additional information 3: 0a9e
Additional information 4: 0a9e372d3b4ad19135b953a78882e789

This exception has been reported to have many causes, but one
possibility seems to be that your computer may not support an advanced
instruction set that the .pyd was compiled for. I found this one
specifically mentioned on the Internet: Advanced Vector Extensions. If
that were the case, you would either need to find a different version of
the module, or upgrade the computer/OS.

It would be worth trying to downgrade the multiarray version to an
earlier one and see if that fixes the problem.

Thank you Thomas
for your kind reply.

I am fully aware to be living on an old machine, old OS, Windows 7, 32-bit 
system
but I have visited every social chat support forum on the Internet: from Python 
to Matplotlib, Numpy, Twitter, Github.

As a newbie I am not aware how to downgrade "the multiarray version to an
earlier one

I simply tried to test Python code from


https://www.section.io/engineering-education/reading-and-processing-android-sensor-data-using-python-with-csv-read/


# Python program to read .csv file

import numpy as np
import matplotlib.pyplot as plt
import csv


"After importing the libraries, we now read the .csv file:

with open('accl1.csv', 'r') as f:
data = list(csv.reader(f, delimiter=',')) #reading csv file


Just read about AVE from Wikipedia

https://en.wikipedia.org/wiki/Advanced_Vector_Extensions



downloaded and run
HWiNFO
and AVE not supported, not greened out


That's too bad; you may be out of luck.  It's possible that someone has 
compiled the .pyd library in such a way that it does not need the 
instruction set extensions.  I'm sorry but I don't know how to find out 
except by trying internet searches - or by downgrading to earlier 
versions of Numpy hoping to find one that works and also can be used by 
the other libraries/programs that need to use it.


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-18 Thread Thomas Passin

On 3/17/2023 11:32 AM, a a wrote:

On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote:


It would be worth trying to downgrade the multiarray version to an 
earlier one and see if that fixes the problem.


Thank you Thomas for your kind reply.

I am fully aware to be living on an old machine, old OS, Windows 7,
32-bit system but I have visited every social chat support forum on
the Internet: from Python to Matplotlib, Numpy, Twitter, Github.

I mentioned the "multiarray" just because of its name in the error message:

"Error module name: _multiarray_umath.cp38-win32.pyd "

I assumed that the code you tried to run required an import from a
module or package whose name included "multiarray".  But I didn't try to
actually look for one.  Now I've checked, and I see it's included with
NumPy.


I simply tried to test Python code from


https://www.section.io/engineering-education/reading-and-processing-android-sensor-data-using-python-with-csv-read/

  # Python program to read .csv file

import numpy as np import matplotlib.pyplot as plt import csv 

"After importing the libraries, we now read the .csv file:

with open('accl1.csv', 'r') as f: data = list(csv.reader(f,
delimiter=',')) #reading csv file


You don't need numpy just to do this import, so you could remove the
numpy import just to test reading the csv file.  But I imagine you do
need numpy for later steps.



As a newbie I am not aware how to downgrade "the multiarray version
to an earlier one.
I just had to do this myself to work around a change in an import that 
broke one of my programs (not a numpy import).  If you can identify an 
earlier version that work - we will use proglib v 3.72 as an example - 
with pip you would use


python3 -m pip install --upgrade proglib<=3.72

To get exactly version 3.72, you would use "==3.72".

NOTE - no space allowed before the first "=" character!.
NOTE - you may need to type "python" or "py" instead of "python3".  Just 
use the one that runs the version of Python that you want to run.


To find which versions are available:

python3 -m pip install --upgrade proglib==

To find out which version you have installed on your computer:

python3 -m pip show numpy

After you downgrade to an earlier version, you can test it just by 
trying to import numpy.  In an interpreter session, just try to import it:


>>> import numpy

If that succeeds, chances are you will be all set.


 Just read about AVE from Wikipedia

https://en.wikipedia.org/wiki/Advanced_Vector_Extensions


I have read that there are other instruction set extensions that could 
be missing besides AVE, that could cause that exception code.  The fact 
that you have a relatively old computer suggests that could be the problem.


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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-18 Thread a a
On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote:
> On 3/16/2023 8:07 PM, a a wrote: 
> > Crash report: 
> > 
> > Problem Caption: 
> > Problem Event Name: APPCRASH 
> > Application name: python.exe 
> > Application version: 3.8.7150.1013 
> > Application time signature: 5fe0df5a 
> > Error module name: _multiarray_umath.cp38-win32.pyd 
> > Version of the module with the error: 0.0.0.0 
> > Time signature of the module with the error: 63dfe4cf 
> > Exception code: c01d 
> > Exception offset: 000269c9 
> > Operating system version: 6.1.7601.2.1.0.256.48 
> > Regional Settings ID: 1045 
> > Additional information 1: 0a9e 
> > Additional information 2: 0a9e372d3b4ad19135b953a78882e789 
> > Additional information 3: 0a9e 
> > Additional information 4: 0a9e372d3b4ad19135b953a78882e789
> This exception has been reported to have many causes, but one 
> possibility seems to be that your computer may not support an advanced 
> instruction set that the .pyd was compiled for. I found this one 
> specifically mentioned on the Internet: Advanced Vector Extensions. If 
> that were the case, you would either need to find a different version of 
> the module, or upgrade the computer/OS. 
> 
> It would be worth trying to downgrade the multiarray version to an 
> earlier one and see if that fixes the problem.


Just reading from search engine:

https://www.bing.com/search?q=how+to+downgrade+_multiarray_umath.cp38-win32.pyd+=QBLH=-1=0=how+to+downgrade+_multiarray_umath.cp38-win32.pyd+=1-50=n=
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-18 Thread a a
On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote:
> On 3/16/2023 8:07 PM, a a wrote: 
> > Crash report: 
> > 
> > Problem Caption: 
> > Problem Event Name: APPCRASH 
> > Application name: python.exe 
> > Application version: 3.8.7150.1013 
> > Application time signature: 5fe0df5a 
> > Error module name: _multiarray_umath.cp38-win32.pyd 
> > Version of the module with the error: 0.0.0.0 
> > Time signature of the module with the error: 63dfe4cf 
> > Exception code: c01d 
> > Exception offset: 000269c9 
> > Operating system version: 6.1.7601.2.1.0.256.48 
> > Regional Settings ID: 1045 
> > Additional information 1: 0a9e 
> > Additional information 2: 0a9e372d3b4ad19135b953a78882e789 
> > Additional information 3: 0a9e 
> > Additional information 4: 0a9e372d3b4ad19135b953a78882e789
> This exception has been reported to have many causes, but one 
> possibility seems to be that your computer may not support an advanced 
> instruction set that the .pyd was compiled for. I found this one 
> specifically mentioned on the Internet: Advanced Vector Extensions. If 
> that were the case, you would either need to find a different version of 
> the module, or upgrade the computer/OS. 
> 
> It would be worth trying to downgrade the multiarray version to an 
> earlier one and see if that fixes the problem.

Thank you Thomas
for your kind reply.

I am fully aware to be living on an old machine, old OS, Windows 7, 32-bit 
system
but I have visited every social chat support forum on the Internet: from Python 
to Matplotlib, Numpy, Twitter, Github.

As a newbie I am not aware how to downgrade "the multiarray version to an 
 earlier one

I simply tried to test Python code from


https://www.section.io/engineering-education/reading-and-processing-android-sensor-data-using-python-with-csv-read/


# Python program to read .csv file

import numpy as np
import matplotlib.pyplot as plt
import csv


"After importing the libraries, we now read the .csv file:

with open('accl1.csv', 'r') as f:
data = list(csv.reader(f, delimiter=',')) #reading csv file


Just read about AVE from Wikipedia

https://en.wikipedia.org/wiki/Advanced_Vector_Extensions

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


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-18 Thread a a
On Friday, 17 March 2023 at 16:32:53 UTC+1, a a wrote:
> On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote: 
> > On 3/16/2023 8:07 PM, a a wrote: 
> > > Crash report: 
> > > 
> > > Problem Caption: 
> > > Problem Event Name: APPCRASH 
> > > Application name: python.exe 
> > > Application version: 3.8.7150.1013 
> > > Application time signature: 5fe0df5a 
> > > Error module name: _multiarray_umath.cp38-win32.pyd 
> > > Version of the module with the error: 0.0.0.0 
> > > Time signature of the module with the error: 63dfe4cf 
> > > Exception code: c01d 
> > > Exception offset: 000269c9 
> > > Operating system version: 6.1.7601.2.1.0.256.48 
> > > Regional Settings ID: 1045 
> > > Additional information 1: 0a9e 
> > > Additional information 2: 0a9e372d3b4ad19135b953a78882e789 
> > > Additional information 3: 0a9e 
> > > Additional information 4: 0a9e372d3b4ad19135b953a78882e789 
> > This exception has been reported to have many causes, but one 
> > possibility seems to be that your computer may not support an advanced 
> > instruction set that the .pyd was compiled for. I found this one 
> > specifically mentioned on the Internet: Advanced Vector Extensions. If 
> > that were the case, you would either need to find a different version of 
> > the module, or upgrade the computer/OS. 
> > 
> > It would be worth trying to downgrade the multiarray version to an 
> > earlier one and see if that fixes the problem.
> Thank you Thomas 
> for your kind reply. 
> 
> I am fully aware to be living on an old machine, old OS, Windows 7, 32-bit 
> system 
> but I have visited every social chat support forum on the Internet: from 
> Python to Matplotlib, Numpy, Twitter, Github. 
> 
> As a newbie I am not aware how to downgrade "the multiarray version to an 
> earlier one 
> 
> I simply tried to test Python code from 
> 
> 
> https://www.section.io/engineering-education/reading-and-processing-android-sensor-data-using-python-with-csv-read/
>  
> 
>  
> # Python program to read .csv file 
> 
> import numpy as np 
> import matplotlib.pyplot as plt 
> import csv 
>  
> 
> "After importing the libraries, we now read the .csv file: 
> 
> with open('accl1.csv', 'r') as f: 
> data = list(csv.reader(f, delimiter=',')) #reading csv file 
> 
>  
> Just read about AVE from Wikipedia 
> 
> https://en.wikipedia.org/wiki/Advanced_Vector_Extensions


downloaded and run
HWiNFO
and AVE not supported, not greened out
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-17 Thread Thomas Passin

On 3/16/2023 8:07 PM, a a wrote:

Crash report:

Problem Caption:
   Problem Event Name:  APPCRASH
   Application name: python.exe
   Application version: 3.8.7150.1013
   Application time signature:  5fe0df5a
   Error module name:   _multiarray_umath.cp38-win32.pyd
   Version of the module with the error:0.0.0.0
   Time signature of the module with the error: 63dfe4cf
   Exception code: c01d
   Exception offset:000269c9
   Operating system version:6.1.7601.2.1.0.256.48
   Regional Settings ID:1045
   Additional information 1: 0a9e
   Additional information 2: 0a9e372d3b4ad19135b953a78882e789
   Additional information 3: 0a9e
   Additional information 4: 0a9e372d3b4ad19135b953a78882e789


This exception has been reported to have many causes, but one 
possibility seems to be that your computer may not support an advanced 
instruction set that the .pyd was compiled for.  I found this one 
specifically mentioned on the Internet: Advanced Vector Extensions.  If 
that were the case, you would either need to find a different version of 
the module, or upgrade the computer/OS.


It would be worth trying to downgrade the multiarray version to an 
earlier one and see if that fixes the problem.

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


Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-17 Thread a a
Crash report:

Problem Caption:
  Problem Event Name:   APPCRASH
  Application name: python.exe
  Application version:  3.8.7150.1013
  Application time signature:   5fe0df5a
  Error module name:_multiarray_umath.cp38-win32.pyd
  Version of the module with the error: 0.0.0.0
  Time signature of the module with the error:  63dfe4cf
  Exception code: c01d
  Exception offset: 000269c9
  Operating system version: 6.1.7601.2.1.0.256.48
  Regional Settings ID: 1045
  Additional information 1: 0a9e
  Additional information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional information 3: 0a9e
  Additional information 4: 0a9e372d3b4ad19135b953a78882e789
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28948] Facing issue while running Python 3.6.0rc1 windows x86-64 web based installer

2022-03-24 Thread Irit Katriel


Irit Katriel  added the comment:

This was reported for 3.6 and there was not enough information to figure out 
what the problem is. I am closing it because it's unlikely that anyone will be 
do anything about this unless it is reported again for a current Python 
version, and with more information.

--
nosy: +iritkatriel
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34643] How to build Release Version of Python in Windows?

2021-12-18 Thread Alex Waygood


Alex Waygood  added the comment:

Given that there has been no activity on this issue for over three years, I am 
closing this as "rejected".

--
nosy: +AlexWaygood
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45969] When uninstalling Python under Windows the "Scripts" folders should be removed from the PATH environment variable

2021-12-02 Thread Steve Dower


Steve Dower  added the comment:

Unless someone can find an authoring bug under Tools/msi, I don't think we can 
do anything about this. We rely on the built-in Windows support for adding and 
removing these variables, and if that's broken, we can't do anything with our 
current setup.

I really want to get us out of this addiction to cluttering up PATH with lots 
of different directories - it's bad for security/reliability/etc. of the system 
as a whole, and I don't like Python being the cause of issues here. But I 
haven't quite come up with the better design yet... 

Anyway, all that to say that I'm not in any rush to expand or seriously mess 
with the current PATH settings. If there's an authoring bug we can fix, great, 
but I don't think this one is on us in a way we can easily deal with.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   7   8   9   10   >