Python IDLE is not launching - python

Error screenshot of 'python3 -m idlelib'[] [This is where the idle is located]Sample screen shot of the program here I recently deletd my old python program and intsalled a new one but now the Python IDLE is not launching when I click it from the start program. Also tried ruuning as a administartor. But when I open the cmd and type: "python3" I am getting the terminal. But I need to code in the python IDLE.
I have adde the image of the python IDLE, if i click that program the notepad/termiunal is not opening.

I got it solved. It seems my 1. I haven't added my path in the user variablse and 2. In system variables the path given is wrong. And yes as said by #TerryJanReedy I have installed both microsoft and python.org versions, so I deleted all files and carefully re-installed again.

Related

Running python files by double click but there is IDLE mismatch

I have Python 3.7.4 installed on Windows 10. For some reasons, my "Edit with Python" option doesn't show up when I right click a Python script. So I made "idle.bat" as the default app to run Python scripts from the installed location "C:\Users\ns200\AppData\Local\Programs\Python\Python37". Now when I double click the Python Script, it runs and IDLE 3.7.1 (see picture) shows up with my code. Now when I execute the code, I get "ModuleNotFoundError" though I have all the modules installed(installed using pip3 function for IDLE 3.7.4)
If I open IDLE manually, Python 3.7.4 shell runs and I need to open the script by going to file, open ,choose the file location and IDLE 3.7.4 shows up (see picture). When I execute the script this time, it runs with no errors (as all modules are already installed for 3.7.4).
I don't know why there is an IDLE mismatch here. How can I run IDLE 3.7.4 every time after double clicking the python script with no module error?
you have selected the idle.bat inside py 3.7.1 , Select the idle.bat which is inside python 3.7.4 , your problem will be solved.
python37.4/lib/sitepackages/idlelib/Idle.bat
Approximate path above

Python command opens python command prompt in new window

I've installed python 2.7 on my machine. Although path variables are set properly, whenever I fire python command, it opens up python prompt in new window. If I try to run it as an administrator, it works fine. But gives an issue for normal user.
It is resolved, python.exe was by default running as an administrator when python command was fired. Resetting it helped in resolving the issue.
reference_image

Idle and Anaconda

I use to have idle. Then I downloaded Anaconda and opened idle through there. I have not used idle for a while but just recently went to go open it up and use it again. However, it seems I no longer have idle on my computer, to my understanding I can still get to idle through Anaconda but I forgot how. Is there a way to open idle through Anaconda without re-downloading idle? If so what command can I use to pull Idle up?
Search for this folder "idlelib" in the Lib folder of the Anaconda version you have installed and you will find idle (check its file type: "compiled python file").
Pin it to your taskbar and run.
You are looking for C:\... <\> ...Anaconda3\Lib\idlelib\idle.bat
There is also C:\ ... <\> ...Anaconda3\Scripts\idle.exe which seems to run a little smoother, but there has to be a Command Prompt open in the background to run. ... ?
Navigate to your Anaconda3 installation folder. Yours could be anywhere, mine is at "C:\ProgramData\Anaconda3", but I installed for all users and you could have selected a random location on your drive. If you managed to add it to the environment variables you could easily find it by running the Command Prompt (not Powershell - has to be Command Prompt) and typing where conda or where anaconda and pressing enter. You should find a folder named Anaconda3 or something of that nature.
If you navigate to this folder, and within it find the "Anaconda3\Lib\idlelib\" folder, within it there is a file called "idle.bat". If you find this "Anaconda3\Lib\idlelib\idle.bat" file you can double click it to run IDLE, although it may be a little messy/outdated/glitchy/strange since you are updating all kinds of folders within Anaconda and some of them may have helped idle.bat run. Mine has a the spyder icon associated with it in the task bar and a blotted out IDLE icon in the top left corner for some reason. You could of course run the full path in command prompt as well if you already know where it is, for instance I would run...
C:\Users\Thomas>C:\ProgramData\Anaconda3\Lib\idlelib\idle.bat
~or~
C:\Users\Thomas>C:\ProgramData\Anaconda3\Scripts\idle.exe
--> It may be easier to just download a new version of Python side by side with Anaconda to run IDLE. I have been attempting to set a shortcut in the Start Menu that runs from anaconda properly for days and have failed. This way, there should be a right click>'run with IDLE' option for python files.
I believe the tilde slash (~/) was meant to imply your home directory since that is what it signifies on a linux machine, but seeing as you could have put it anywhere on the machine, even directly on the C:\ drive, maybe he meant 'unknown file path'.
If you are running MacOs (currently I am on Catalina - MacOs10.15) it is quite simple to run IDLE from Anaconda environment:
Launch Anaconda
Go to MacOs Terminal.
Type IDLE3
warning: if you type IDLE, the Python 2 IDLE will be opened ... but if you are using Python3 installed with Anaconda ... it doesn't work properly.

Python IDLE icon appears for a second and then disappears, the IDLE doesn't start at all. - on mac

I was working on Python IDLE editor on a Mac but for some reason now every time I click on the IDLE icon, it pops up in the doc for a second and then it just disappears. The IDLE just doesn't run anymore.
In one of the recommendations I found online, it says to type /usr/local/bin/python3.6 -m idlelib, which I did in the console and it started up the Python shell, from which I can open a new file and start coding.
However, I would like to avoid doing this and be able to just start IDLE using the icon in the application folder.
I've downloaded and installed Homebrew, Pandas, PyCharm and among many others because I've seen some recommendations on installing these without complete understanding of them. I'm wondering if any of these programs altered something in the IDLE which is causing it to crash?
This is for Python 3.6 on Mac OS.

Python Launcher Mac

On my mac I am trying to make a Python script open by default in the Python Launcher.
I left click on the script and select "open with" and select the Launcher. Every-time I do this Terminal pops up, the Launcher window appears briefly. Then a messages pops up in a window: "Python Launcher can only run certain scripts try another."
Something along those line (the message has stop popping up since the first time I tried it but the script still doesn't run). I tried everything, GUIs, and basic scripts (like print "Hello World"). None work!
I tried doing the same thing on other computer and I get the same problem. What am I doing wrong ?
Does your script use a shebang line:
#!/path/to/executable/python2.6
And does it have execute permissions?
chmod +x path_to_file.py
It should run OK like this.
Assuming you're talking about Anaconda, Launcher is now deprecated, so your approach will have to change anyway. It has been replaced by Navigator.
Make sure you have updated Anaconda within terminal using
conda update conda
Then, you can install Navigator with
conda install anaconda-navigator
You will see a new icon show up that functions much the way Launcher used to. Your script will now have to be tied to it instead of launcher, assuming you figured that out with previous commenters' help.

Categories