Can't run python on windows anymore - python

Since the most recent update to Windows 10, I have been seeing this message every time I try to do anything with Python
I have reinstalled it, tried running it as administrator. Nothing works.

First make sure that python.exe exists in the given directory and that its not a zero-length file. More likely though is that you installed the wrong version of python. Make sure you download and install the x86 version as it will work on both 64-bit and x86 systems. Do a full uninstall and install python via the Windows x86 MSI installer.
Edit:
If this doesn't work please provide more information on which specific Windows 10 version you are running and which python installer you are using.
Edit 2:
You can also get more information from the Windows Event Log

I think the reason is that python.exe has size 0 Kb. It could happen because you (and me too) didn't exit from Python correctly.
The way to fix the issue is to re-install Python or download "portable" version:
https://www.python.org/downloads/release/python-385/
By the way, one of the way to exit from python (v3) in Windows:
>>> import sys
>>> sys.exit()

I've also had "This app can't run on your PC" windows 10 dialog box starting to appear after I tried to start x64 app from python script under x86 python.
Uninstalled x86 python, installed x64 python and all started to work normal.

I didn't have to reinstall Python.
python.exe inside my env\Scripts\ became 0kb for some reason. So I created another virtual-env and copied python.exe from there to this folder. Then it started working.

Related

How to make Python 3.9 run command prompt windows 10?

"python --version
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases."
This is what I get trying to make sure it works (clearly it doesn't). I'm quite a rookie with all this. I started cause I wanted to run some script on bluestacks, so I needed Python and ADB added both PATH. The problem comes here.... It is indeed added to Path:
C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Users\Sierra\AppData\Local\Microsoft\WindowsApps;C:\platform-tools;C:\Users\Sierra\AppData\Local\Programs\Python\Python39;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\Lib;
This is PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
This is PYTHONPATH (I made it since I saw someone saying it would fix it):
C:\Users\Sierra\AppData\Local\Programs\Python\Python39;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\Lib;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\include;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\DLLS;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\Lib\site-packages
Weird enough the fact that ADB works fine:
C:\Users\Sierra>adb --version Android Debug Bridge version 1.0.41 Version 30.0.5-6877874 Installed as C:\platform-tools\adb.exe
Since I did the same in both cases, I can't get why it's not working. Maybe I did something wrong with the Python version I downloaded? Weird thing too, since I also have stilled version 3.8
Also, the script I need says "Python 3.7.X installed and added to PATH." I guessed 3.9 would work, since it's the newest
I apoloogize cause my English. I'm not native speaker, so I could have messed up somewhere. Many thanks!!
Forgot to tell, I use Windows 10
When you run the setup exe for python a list of tiny boxes should pop up and one will say add PATH to python? If you click yes it will add PATH to python which seems like your issue I think? If you have multiple versions of python installed that could cause a issue type python in cmd if it has a error then you didn't install python properly. Double check you have all the required modules installed if that doesn't work then I'm lost. Anyways here's the code to open cmd.
import os
os.system("cmd")

No Python 3.8 installation was detected

Python installation screenshot
1.i Uninstall everything of python with advance uninstaller . ( register file and ...)
2.i download the last version of Python from python.org
3. i add the Include PATH file when start the installation of Python.
BUT I don't KNOW WHY ITS NOT Installed !
Delete Python3 Folder--> C:\Users\USERNAME\AppData\Local\Programs\python
Control Panel--> Uninstall a Program
Right Click on Python and then Change--->Modify
Click on Repair Python.
and then:
Control Panel --> Uninstall a Program
Now -->uninstall Python
Note: To avoid problems, it is better Delete path Python in edit environment variables windows
Error Code 0x80070643
I found it.
if you are not administrator of the system , and change the location of installation , for example (c:\python) this error will be appear .
so you must be install python on (c:\users\'your username'\App Data\Local\Programs\Python)
and after installation python go to system environment and add the path into this.
For Windows 10 :
First install windows x86-64 executable installer and open it.
Then click on repair and done.
If this occurs while uninstallation :
Do the above steps and then uninstall it.
I accidentally copied the python folder from the installed location into my C drive and encountered this problem. Following steps worked for me.
Run the Python installer (.exe) file
Select the repair option, let it process.
Run the Installer again. This time select uninstall and let it process
Run the Installer again and this time go with the customization option and check the
Add path option also.
open cmd and type python --version, if it displayed python version. You are good to go.
Windows 10.
Had this issue from a while and after a lot of hit & trials, finally resolved it.
Downloaded the Windows troubleshooter.
Removed every application option with Python's name as suffix, and tried uninstalling from Control panel.
It worked. And then I installed the required python version with ease.
Troubleshooter : MicrosoftProgram_Install_and_Uninstall.meta.diagcab
Link to download : https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d
Choose custom installation then next .. your problem will get solve it worked for me.

Python Not Installing on Windows 7 - The Installer Won't Even Appear

Trying to install python (version 3.7.1) on windows 7, and the installation file appears in my downloads folder. However, when I try to run the installation file, as admin, I get the prompt asking if I want to allow the program to make changes to my computer, which I allow, then the installer window doesn't appear. Nothing happens. I can't find a background program running, nothing. It's like the executable doesn't do anything. I'm really stuck.
If it helps I'm using a Windows 7 64-bit computer.
Same problem I also face that you are now facing.
The simplest ways to run a python software foundation in windows 7 is.
First completely update your windows 7. It take some minutes and some time Few hours.
Once you install windows update.
The PYTHON software will run normally.
Accounting to my experience.
i just install Anaconda which has python and packages, very convenient : https://www.anaconda.com/download/

I installed Python 3.4.3 over 3.4.2 on Windows 7... and now I cannot uninstall Python

I installed Python 3.4.3 over 3.4.2 on Windows 7 and got problems with IDLE not starting.
When I use the Windows uninstaller via the control panel I get the message:
"There is a problem with this Windows Installer package a program required for this install to complete could not be run. Contact your support personnel or package vendor."
If I try to remove Python via the msi file then I get the same message.
There is no Python34 directory on my machine. I noticed that there is an entry in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\Modules. I didn't want to mess with my registry, but can I safely delete this entry? Is there any more to delete?
I used MicrosoftFixit.ProgramInstallUninstall and I was able to remove Python34 and then it reinstalled without any problems.
Had a similar problem. This is what I did:
Restart computer (kill any running processes of Python)
Delete the main Python folder under C drive.
Using CCleaner (or a similar application), use the Tools -> Uninstall feature to remove Python (if it is still there after deleting the folder)
Then go to the Registry window in CCleaner and clean the registry. Python should now be completely gone from your computer.

Python 3.2 doesn't work with python 2.7

I already have python 2.7 (installed using activepython). I'm trying to use python 3.2 just to learn more about it so i downloaded it from python.org
python 2.7 still works perfectly, but python 3.2 gives me this error when i try to open the ide.
and then I see the send error window, if i install python 3.2 using activepython i see the same error.
I'm using windows xp pro sp3 32 bit and i had the same error on sp2... How do I fix it?
EDIT #Zuljin
This is the first time that i use dependancy walker so could you give me a hand please
this is what i see
what does that mean? I already have these files...
I saw a lot of answers here. But, I think the file that you are trying to run is not correct
C:\Python32\Pythonw.exe
is not the one you use to open idle.
Open
C:\Python32\Lib\idlelib\idle.pyw
Python 2.x and 3.x can cohabitate perfectly in win xp and win 7, either 32 or 64 bits.
If you first installed the ActiveState Python distribution, be careful when installing python-3.2.2.msi.
When you arrive to the customize python 3.2.2 screen, (un)check 'register extensions' to make the feature unavailable (that is: do not register extensions).
I have installed this way both distributions in different computers without any problem so far.
Note: Check your environment variables. Only python 2.7 should be in the path (if you installed before the two distros you could have them both in the path. Remove python 3.2 path)
Edit:
From Ankit post I realized that in fact you were trying to open IDLE, maybe.
If you follow my installation instructions when you call idle.bat from the py3.2 idlelib folder you actually get idle for python 2.7 as this is what the call find in the windows path. To be able to open idle for py3.2 in the presence of python 2.7 as the registered python, I use a .bat file modified from that in the distribution:
idle_stay.bat
#echo off
rem Working IDLE bat for Windows - Custom bat for py3k as secundary python
C:\Python32\pythonw C:\Python32\Lib\idlelib\idle.pyw %1 %2 %3 %4 %5 %6 %7 %8 %9
The name idle_stay.bat is because I put this file in the folder where the official idle.bat is (C:\Python32\Lib\idlelib\idle_stay.bat). In this way it does not get overwritten each time I unisntall and reinstall a new version of python 3
It seems to me you have associated a *.py or *.pyw file extension type to some version of python.exe and/or pythonw.exe you aren't clear about. This is often, but not exclusively done from within Microsoft's "explore.exe" File Manager (I believe in Options).
I disagree that this is a reliable method:
C:\Python32\Lib\idlelib\idle.pyw
as this method will run whichever program is assigned to the "pyw" extension. That could be:
C:\Python32\pythonw.exe
or
C:\Python26\python.exe
or whatever might have happened to your file extension association as per OS or bad PATH environment variable setting. It is better to do something like this:
C:\Python32\pythonw.exe C:\Python32\Lib\idlelib\idle.pyw
where you are explicidly telling the OS to run the python executable from a specific path and selecting a specific python script in the file/folder hiearchy.
Another thing you can try to gather info is just:
python.exe -V
which will tell you the version number.
Another thing you can do:
Open a DOS command prompt and type:
set PATH=C:\Windows;C:\Windows\system32;C:\Python32
python.exe and note the version and whether is runs.
exit()
exit
Once working debug your PATH. You can use this Python script to gather intel.
If you turned off your WinXP findfile stuff (like I have) you can use this script:
inpath.py can help shed some light.
Run this python script like this:
Drop to a DOS prompt
cd to your folder with a working python.exe version.
and type python.exe inpath.py python*
where inpath is in that same folder for this test/debug.
inpath.py will search your path for all files associated as "runable" in your OS and that is in your "PATH" with the python*.* pattern.

Categories

Resources