Re: How to manage python shebang on mixed systems?
On 2022-11-07 21:27:26 +, Chris Green wrote: > Barry Scott wrote: > > env is always available as /usr/bin/env - I think its spec'ed in posix that > > way. > > > > The only reason that things are in /bin are for systems that need a subset > > of > > programs to boot the system to point it can mount /usr. env is not going to > > be > > needed for that use case. > > > Given that the problem system is running a very old Linux I'm not sure > what chance there is that it's fully posix compliant. It doesn't have to be fully posix compliant. Just reasonably posix compliant. > If using "#!/usr/bin/env python3" is a way of avoiding problems if > python3 isn't in /usr/bin then why is it any better depending on env > being in /usr/bin. Because env is a standard unix utility which has been in the same place for 30 years or so and is unlikely to be somewhere else or missing completely. Python3 OTOH is not a standard unix utility. It may not be there at all or it may be installed in /usr/local or /opt or even in the user's home directory. (Yes, of course "standard unix utilities" may be missing, too. For example on an embedded system there might only be the bare minimum to run the application. I even had a redhat system once which didn't have grep installed.) (Personally I avoid using env: I don't want my scripts to depend on the PATH. But that's a different issue.) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | [email protected] |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list
Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8
Is there no one who can help? Von: [email protected] Gesendet: Freitag, 4. November 2022 15:10 An: Eryk Sun Cc: [email protected] Yes, there is always the message “modified successfull”, “installed sucessfully”, but IDLE does’t start. I tried it with the newer Version, too. Ist 3.11.0 for 32 bit, but it also doesn’t work. Do you have other suggetions, that it works? Von: Eryk Sun Gesendet: Donnerstag, 3. November 2022 22:50 An: [email protected] Cc: [email protected] On 11/3/22, [email protected] wrote: > Is there a reason, why it is not installed? Its the same check mark in the > installer like IDLE… Did you try what I suggested? Modify the installation to remove the tkinter/IDLE component. Then modify it again to select the component to be reinstalled. Also, try to repair the installation. This may reset any DLLs or extension modules that were missing or that were the wrong version. Ignore the suggestion from Nithish to install tkinter via pip. tkinter is part of the standard library and cannot be installed via pip. There is no tkinter package on the Python package index (pypi.org). -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8
On 11/9/2022 7:02 PM, [email protected] wrote: Is there no one who can help? Is there a reason why you tried to install a 32-bit version? Most personal computers are 64-bit ones these days. Also, I don't remember if you are running Windows or not. One problem for getting help from the list is that there have not been many details given. "Doesn't start" is not helpful. Are there error messages displayed on the terminal? How did you try to start it? Does Python run at all? A Python installation normally includes a batch file that launches idle. This batch file may not be on your path for one reason or another. If so, it would not run when you type "idle" at a command line. So the first thing to do is to figure out if you have either the Python program idle.py or idle.pyw, or the batch file idle.bat (for Windows) On Linux Mint, when I typed "idle" at a terminal, I got this message: "Command 'idle' not found, but can be installed with: sudo apt install idle" So that's how you would get it with that flavor of Linux. I'm going to walk through what I would probably do if I had the same problem on Windows (I'm going to assume that you are running Windows). It's a little long to write out, but not really that hard. Basically, there are only a few steps: 1. Find your Python installation; 2. Look in the installation location to see if the idle program is there; 3. If it is, try to run it and note any error messages. First you need to find out where your Python installation is located on your system disk. If you don't know, one way to find out is to run the following command in a console window: where /R %USERPROFILE% python.exe You may be surprised that there more several ones that you didn't expect, such as (on my computer): C:\Users\tom\AppData\Local\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\python.exe It seems that Windows has its own Python installation; that's not the one you want. You are looking for one that looks like this (with your own user name, of course, instead of mine): C:\Users\tom\AppData\Local\Programs\Python\Python310\python.exe Appdata\Local\Programs is where Python3 usually gets installed. Now we know that I have Python 3.10 at C:\Users\tom\AppData\Local\Programs\Python. You may be using a different version of Python; if so, just use that version instead. Idle is normally installed in the directory tree under python. Let's call the top of that tree %PYTH0N%. On my system, as we see above, that is C:\Users\tom\AppData\Local\Programs\Python\Python310. Idle should be at %PYTHON%\Lib\idlelib Open Windows explorer, and navigate to that directory. If you have that directory, then you should be able to run idle. If it doesn't exist, That's a problem and needs to be fixed, probably by a fresh install of Python. If it does, you will see the batch file idle.bat. Double-click it, and idle should run. If it does not, see below. That's not a convenient way to run idle time after time. Either you need to get idle on your path, or perhaps it will be available using the windows Start menu. Check that out by tapping the Windows key, then typing "idle" (without the quotes). It may be there. But look closely, for it may be the idle associated with a different version of Python than the one you want to use. For example, on my system I have Idle in the Start Menu, but only for Python 3.7 and not Python 3.10 which is the most recent version I have. If you double-clicked on the idle batch file but it failed to run, then you need to get any error messages. You need to run it from a console so you can see any output. Open a console. you want to run idle using python and not pythonw (because pythonw will not open a window). So in the console, type "python " (without quotes but with the space), then the path to the file. The path to the file is a lot to type, and it's easier to just drag the icon for the file (remember, it's idle.py) into the console window. Press the key and idle should run. If it doesn't, note any error messages. Then come back here and tell us what they were. It's possible that the "where" program didn't find your python installation. That would be because it's installed somewhere outside of your user tree, like Program Files. You can look again in the entire disk (assuming it's on the c: drive, which is almost certainly so): where /R c:\% python.exe Von: [email protected] Gesendet: Freitag, 4. November 2022 15:10 An: Eryk Sun Cc: [email protected] Yes, there is always the message “modified successfull”, “installed sucessfully”, but IDLE does’t start. I tried it with the newer Version, too. Ist 3.11.0 for 32 bit, but it also doesn’t work. Do you have other suggetions, that it works? Von: Eryk Sun Gesendet: Donnerstag, 3. November 2022 22:50 An: [email protected] Cc: [email protected] On 11/3/22, darks
Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8
On Thu, 10 Nov 2022 00:02:44 +, declaimed the following: >Is there no one who can help? > Your problem description isn't detailed enough to even guess what you are finding incorrect. If you are on Windows, once you've done an install, shove the installer file off into some archive and don't touch it again unless you need to reinstall or repair the existing install. Do a search for idle.* Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6 PS C:\Users\Wulfraed> Get-ChildItem -Path C:\Python38\ -Recurse -Name -Filter "idle.*" Lib\idlelib\idle.bat Lib\idlelib\idle.py Lib\idlelib\idle.pyw Lib\idlelib\Icons\idle.ico Lib\site-packages\pythonwin\pywin\idle Lib\site-packages\pythonwin\pywin\IDLE.cfg PS C:\Users\Wulfraed> type C:\Python38\Lib\idlelib\idle.bat @echo off rem Start IDLE using the appropriate Python interpreter set CURRDIR=%~dp0 start "IDLE" "%CURRDIR%..\..\pythonw.exe" "%CURRDIR%idle.pyw" %1 %2 %3 %4 %5 %6 %7 %8 %9 PS C:\Users\Wulfraed> c:\python38\lib\idlelib\idle.bat ... opens something IDLE related (seems to be an interactive Python shell, but a configuration item allows setting it to open an edit window instead). Interesting -- I could have sworn there was a Python38 entry on the Windows start menu, but I seem to have removed it. I don't use IDLE, and that was the primary item in the Python38 entry. I normally use an old version of PythonWin (fyi: I'm using an old version of the ActiveState Python package). I also have PyCharm installed. -- Wulfraed Dennis Lee Bieber AF6VN [email protected]://wlfraed.microdiversity.freeddns.org/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8
On 11/9/22, [email protected] wrote: > Is there no one who can help? If you can't run IDLE via `py -3.10-32 -m idlelib`, then something isn't installed properly. You reported an error that IDLE fails to load because importing tkinter fails. Did you try `import tkinter` in the REPL? tkinter depends on the _tkinter extension module. Try `import _tkinter`. If the latter fails because of a missing DLL dependency, check the "DLLs" directory in the installation directory for the TCL/Tk dependencies. They're "tcl86t.dll" and "tk86t.dll" for Python 3.10. The installation directory should also have a "tcl" directory, which should contain "tcl8.6" and "tk8.6" directories among others, with many .tcl files. -- https://mail.python.org/mailman/listinfo/python-list
Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8
Sorry about the typo at the end. If you need to search the entire disk, use this command instead of the one I had in my last post: where /R c:\ python.exe On 11/9/2022 9:00 PM, Thomas Passin wrote: On 11/9/2022 7:02 PM, [email protected] wrote: Is there no one who can help? Is there a reason why you tried to install a 32-bit version? Most personal computers are 64-bit ones these days. Also, I don't remember if you are running Windows or not. One problem for getting help from the list is that there have not been many details given. "Doesn't start" is not helpful. Are there error messages displayed on the terminal? How did you try to start it? Does Python run at all? A Python installation normally includes a batch file that launches idle. This batch file may not be on your path for one reason or another. If so, it would not run when you type "idle" at a command line. So the first thing to do is to figure out if you have either the Python program idle.py or idle.pyw, or the batch file idle.bat (for Windows) On Linux Mint, when I typed "idle" at a terminal, I got this message: "Command 'idle' not found, but can be installed with: sudo apt install idle" So that's how you would get it with that flavor of Linux. I'm going to walk through what I would probably do if I had the same problem on Windows (I'm going to assume that you are running Windows). It's a little long to write out, but not really that hard. Basically, there are only a few steps: 1. Find your Python installation; 2. Look in the installation location to see if the idle program is there; 3. If it is, try to run it and note any error messages. First you need to find out where your Python installation is located on your system disk. If you don't know, one way to find out is to run the following command in a console window: where /R %USERPROFILE% python.exe You may be surprised that there more several ones that you didn't expect, such as (on my computer): C:\Users\tom\AppData\Local\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\python.exe It seems that Windows has its own Python installation; that's not the one you want. You are looking for one that looks like this (with your own user name, of course, instead of mine): C:\Users\tom\AppData\Local\Programs\Python\Python310\python.exe Appdata\Local\Programs is where Python3 usually gets installed. Now we know that I have Python 3.10 at C:\Users\tom\AppData\Local\Programs\Python. You may be using a different version of Python; if so, just use that version instead. Idle is normally installed in the directory tree under python. Let's call the top of that tree %PYTH0N%. On my system, as we see above, that is C:\Users\tom\AppData\Local\Programs\Python\Python310. Idle should be at %PYTHON%\Lib\idlelib Open Windows explorer, and navigate to that directory. If you have that directory, then you should be able to run idle. If it doesn't exist, That's a problem and needs to be fixed, probably by a fresh install of Python. If it does, you will see the batch file idle.bat. Double-click it, and idle should run. If it does not, see below. That's not a convenient way to run idle time after time. Either you need to get idle on your path, or perhaps it will be available using the windows Start menu. Check that out by tapping the Windows key, then typing "idle" (without the quotes). It may be there. But look closely, for it may be the idle associated with a different version of Python than the one you want to use. For example, on my system I have Idle in the Start Menu, but only for Python 3.7 and not Python 3.10 which is the most recent version I have. If you double-clicked on the idle batch file but it failed to run, then you need to get any error messages. You need to run it from a console so you can see any output. Open a console. you want to run idle using python and not pythonw (because pythonw will not open a window). So in the console, type "python " (without quotes but with the space), then the path to the file. The path to the file is a lot to type, and it's easier to just drag the icon for the file (remember, it's idle.py) into the console window. Press the key and idle should run. If it doesn't, note any error messages. Then come back here and tell us what they were. It's possible that the "where" program didn't find your python installation. That would be because it's installed somewhere outside of your user tree, like Program Files. You can look again in the entire disk (assuming it's on the c: drive, which is almost certainly so): where /R c:\% python.exe Von: [email protected] Gesendet: Freitag, 4. November 2022 15:10 An: Eryk Sun Cc: [email protected] Yes, there is always the message “modified successfull”, “installed sucessfully”, but IDLE does’t start. I tried it with the newer Version, too. Ist 3.11.0 for 32 bit, but it also doesn’t
