How can I resolve the issue of Python Idle not opening? - python

Good day everyone, I just bought a system with window 8. I downloaded Python 3.10 and after installing it,to my surprise, the Idle does not open when I click, although the command prompt is working. I've tried all possible best to resolve this, all to no avail. How can I overcome this?

With the given details, I can't say something that will work 100% but there are people who were dealing with similar issues:
I had this issue too, I realized that I had installed the 32bit version on a machine running 64bit. So I uninstalled and installed the 64bit and it's fine now.
or
Can you launch Python from a command line and then launch IDLE from there?
cd c:\python33
python
After python starts, enter the following:
import idlelib.idle
I suggest you either try these methods or just straight up reinstall Python to your computer. But be sure to download the right one for your hardware.
Source:https://bugs.python.org/issue16365
Another place which you can visit as well:Python IDLE shell not opening
Again, you need to provide more detail.

Related

Python versions in my PC shows 2.7.17 instead of 3.8.5

Yesterday I've been trying to install Python 3.8.5. I got the installer from the python website. My problem is that whenever I run python --version in the command line, it keeps saying, like in the image above, Python 2.7.17.
Today I also installed the Microsoft store package, and it's the same.
But running py apparently gives me the correct version 3.8.5. Does this mean that every python program I'll write will use the current version? That's what I currently want to make sure of.
As a side note also, I uninstalled all other python versions except 3.8.5 that I saw in my settings>Apps list. So, that adds to my confusion why running python --version would still show 2.7.17.
Maybe not as relevant, but I also have WSL2 enabled on my machine, I would like to install python to both. At the moment I'm focusing on the Windows10 part, but if there's a solution that will help both, that'll be awesome.
Thanks in advance!
[update]: adding python3 --version screenshot
[update]: yet another confusing part for me:
should I just let this be?
Is this something I need to straighten up first before moving forward?
are my python programs going to be ran in version 3.8.5 and not
2.7.17?
I know my answer is very late but i see a lot of people facing this problem. So if you want to interact with the latest Python version in your command prompt, you just need to set newer (or which one you want) Python path variable above/before other Python version's path variables. This solution also helped me a lot with other path problems.
This is a problem with your PATH environment variable being set incorrectly. I'm guessing that you installed Python 3 globally, after you had Python 2.7 installed. Whenever you do this and have the option Add to PATH checked, it will overwrite the default python location to the new install, thus causing Python 3 to now open instead. You can change this back manually by changing the value in PATH.
I'd suggest using something like pipenv to manage your python versions and respective libraries, that will create a sandbox for your application to run in and will always point to the correct dependencies.
Ok, so hopefully this fixes every question I had. Hopefully comments will assure me that is so.
What I did was, delete the environment variables relating to Python 27. Found the Python3.exe path and added that to the path variable. Not exactly sure how that works, but it did give me the outcome I wanted to see.

windows suddenly can't run python "this app can't run on your PC anymore"

I was coding on VSCODE and when I wanted to run the script I suddenly got thrown this error by windows
so now if I type python on cmd I get this error and python returns "Access is denied."
this happened suddenly so one minute I could run python and now I can't, so I don't think it's a windows update causing a problem
I looked around and it seems most people that get this error downloaded 32bit version of an app on a 64bit machine
edit: it seems like python.exe now is 0kb it's corrupted so I'll probably have to reinstall python but I'd love to know what caused it.
I've run into all kinds of issues in VSCode. If you can, take a look at something like Atom or Sublime Text. I've found them to be a lot less fussy.
Ran into same issue. Try downloading "Windows x86-64 MSI installer" from this link https://www.python.org/downloads/release/python-2718/ for Windows. This one worked for me.
This is the latest 2.X version as of writing this answer. To future check the 2.X latest release if any from the default download page of python.

Opening IDLE from Terminal

I'm new to programming and to be more specific, Python. I was going through the installation process from Robert Sedgewick's Introduction to Programming in Python website until right before the section "Downloading and Installing the Booksite Library". My problem occurred with:
In the Terminal window issue the command idleX.Y (for example, idle2.7). If an IDLE window appears, then you have installed IDLE properly. Close the IDLE window.
As I was installing Python 2.7, I attempted to use the command idle2.7, but I received the following response. As far as I can tell, I followed all of the directions provided by Mr. Sedgewick's website and I have already verified that Python was being installed as version 2.7.10. After looking for answers online, I found a similar one here on Stack Overflow. Unfortunately, the potential solutions listed for that question didn't help resolve my issue. At this point, I should mention that I am trying this on a MacBook Pro (2015 model) running the latest version of OS X (El Capitan).
Thanks for your help!
For 2.7, the following, where 'python' is 'whatever string needed to start 2.7' (perhaps 'python', perhaps 'python2'), should work on any OS:
python -m idlelib.idle
For 3.x, .idle can be omitted. In *nix (but not on Windows), python should probably be replaced by python3. The usability of shortcut scripts such as 'idle2.7' depends on the script being both present and on the executable path. That, in turn, depends on the specific installers. In the last year, Python core developers have veered away from the use of a multiplicity of short-cut scripts, which are not dependable, toward python -m module, which is dependable as long as one can start a particular version of Python. On Windows and, I believe on Mac, after using the PSF installers, python can be replaced by py -x or py -x.y if one has multiple python installations.

Python 3.4 IDLE not working properly in MacOSX 10.6.8 Snow Leopard, crashes when the editor is started

I am new to Python and I have installed the 64-bit version 3.4.1 using the .dmg installer from the Python website, and when I start IDLE and try to create a new file, IDLE crashes and quits. Same thing happens when I try to load a Python file using the "File > Open" option.
I am running Mac OSX 10.6.8 Snow Leopard on an iMac Intel Core i3 21.5in, and the Python version is 3.4.1.
IDLE itself seems to work, it's only when I try to create a new file or load a file that it quits.
Just to add, the create new file opens a small blank window with no header, which then causes both windows to become unresponsive. I would include a screenshot but I don't have enough rep :(
EDIT: I just installed an older version of Python (3.3.5), and have encountered the same issue, which makes me think that maybe it's something to do with my setup.
SOLUTION:
Solved by installing Python version 3.1.0, in which the Python runtime and the IDLE editor both seem to work with no problems (so far).
I would add that:
I am only writing really simple scripts based on a tutorial and
The editor only works when started by clicking on File > New Window
I have never heard of this problem, but I suspect a tkinter problem. If you have not, please read and follow this tcl/tk on Mac advice. If you continue having problems, I strongly recommend you post to the python-list mailing list, where some python-mac users hang out, including one of the people who maintain python and idle on osx. You can easily do so at news.gmane.org in their gmane.comp.python.general newsgroup mirror of the list.

Problems in fully uninstalling Python 2.7 from Windows 7

some months ago, I installed Python 2.7 on my laptop (my os is Windows 7).
After, I decided to use Python xy 2.7.3 instead of 'pure' Python; so, as suggested, I removed Python 2.7 and tried to install Python xy 2.7.3. However, when I tried to run the .exe file for installation, a warning window appears telling me that Python 2.7 is already installed on my computer. I tried to install a different version of Python xy (2.6) and everything went fine; however, I'd really prefer to use the latest version of Python xy.
Actually, I can't figure out what went wrong whie uninstalling Python 2.7; does someone have any clue?
I can tell you that I followed the 'normal' procedure for programm uninstalltion; control panel -> Programs -> Remove Program
Thanks in advance
Stefano
Run regedit, backup and delete the registry keys:
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_CURRENT_USER\Software\Python
My problem occurred when changing from Canopy to Python(x,y).
So, also delete all folders that are left behind when uninstalling.
https://support.enthought.com/entries/23580651-Uninstalling-Canopy
I also had this issue as well. It was due to third party installs. Even though you have uninstalled python, it leaves all the third party libraries that were installed and I think Python(x,y) just detects the directory.
To fix, uninstall Python 2.7 and then check to see if C:\Python27 still exists. If it does, go ahead and delete and then try installing Python(x,y). That is what worked for me.
I faced this issue: I tried to uninstall the python and fresh install, reason my pip version issue was not getting resolved. So I deleted the python folder, removed python from system path, and when I tried to uninstall from "Uninstall a program" in control panel, it showed "Windows installation package" error window and could not clean uninstall.
Solution what i found was: In the "Uninstall a program" select python and click repair. And then uninstall the python, it worked for me. Hope this helps and save some time.
PS: I am pretty new to python, and any help correcting me would be appreciated.
Maybe to put an answer out there.
Uninstalling anything from windows can have multiple side effects residing completly on your specific machine. As to what is common:
-> Python sets itself in your windows path. Here is how to modify your windows path: http://www.computerhope.com/issues/ch000549.htm
It means that there is a probability that python is gone but the path entry might not be. That is a guess however -> more information needed
-> Are you sure that everything was removed from your computer? If you already did the normal uninstalling process - try to look up if any python directory is still present.
-> Thirdparty installed? Have you downloaded any libs that are still on your machine.
Besides from that - it could be anything - the more information you give us the more we can say about it.
Maybe this post will help you: How to completely remove Python from a Windows machine?
I had python 2.7.12 and wanted to uninstall it for 2.7.9. I had the same problem as you and to fix it I tried to delete all of the local files and then uninstall however it still gave me the same error. So instead I decided to repair the python 2.7.12 and then uninstall which worked perfectly and completely got rid of the error.
I had python 2.7 installed and enthought canopy. I wanted to switch to python(x,y) to access a full version of the OpenCV library. python(x,y) installation complained about python 2.7 already being installed after:
1)Using windows control panel
2)Removing all lingering python files
3)Removing the windows path as suggested above
Not until I removed all registry entries related to python/enthough did python(x,y) install without issue.
I installed Enthought before. When I wanted to install Python(x,y) instead, I met the problems above.
After I had tried to uninstall Enthought and Python(x,y) from the Control Panel and then restart the PC, the problem still occured the next time I installed Python(x,y).
I solved this problem by:
deleting all the relevant files in C:/User/UserName/AppData/ about Python, including the third party softwares like Enthought;
deleting the Path in user and system Environment;
=====the two steps were failed if I didn't do the third step.=====
deleting the register keys as #Daniel said. (include all the relevant keys with the prefix py if you installed the third party software about Python. )
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_CURRENT_USER\Software\Python
Locate that set up file which was used to install Python. Run it and choose repair. If that doesn't solve the problem. Go to c:\Python(x,y) and delete this folder completely by shift+Del.
Run that set up file again and click on "Change" which will ultimately install the Python again. By default in my case option to add path and making that version of Python the default on my system was unchecked which can be figured out by seeing the red cross mark in one of the installation screen. Click on it if you want set up to make it default Python version and also click on the option to indicate you want the path to be added in windows environment variable.
No need to touch registry as previous ones will be overwritten again.
In my case it worked. I was getting error like:
Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can't find encoding
Besides that un-installation was failing from control panel. So above steps solved all of my problem. Hope it helps.
I Repaired/Modified to install all the components for the Python
version I wanted to uninstall.
Once that was done, I clicked on Uninstall/Change and that uninstalled it for good.

Categories