Python IDLE not opening due to Tcl/tk error - python

I have just installed the latest version of Python 3.6.5 from python.org. I am using 64 bit Windows 8.1 .Earlier it was showing all kinds of .DLL errors, I tried installing all the updates and C++ Redistributable but nothing happened, then I manually downloaded all different DLL's and pasted them in the System-32 folder. By doing that the python command shell did start working but as soon as I try to open the IDLE, nothing happens, no error message is shown and nothing pops up on the monitor.
I read a lot of answers on the net and when I tried writing "import tkinter" in the python command shell it shows that the module not found and this message also - " import _tkinter # If this fails your python may not be configured for Tk" .
Please resolve this issue.

If you did not have the C runtime (CRT...) .dll MS Visual C++ applications compiled with VS2015 or VS2017, including Python since 3.5, it is very likely because you turned off automatic Windows updates. If you got interactive Python working, you must have gotten the right one installed.
If _tkinter is not installed, it must be because the box for optionally installing tcl/tk, _tkinter, tkinter, and IDLE was not checked when you said 'install'. If you still have the installation file where it was when you ran it, you can go to the Control Panel installed programs dialog, click on 3.6.5, and ask to 'Repair'. You should be able to add the needed checkmark. Otherwise rerun or redownload the file from python.org.
If you need further help with installation questions, the python.org python-list is sometimes a better forum.

Related

Python showing in Windows start menu after uninstalling

I decided that now is as good a time as any to learn Python, so I went to download the latest version 3.9.0. After downloading it, I used the Windows search bar to find that 3.8 was already installed (from a previous attempt at learning Python).
I clicked on 3.8 where it prompted "Modify, Repair, Uninstall". After uninstalling, it's unfortunately still there. The files are nowhere to be found, and I can't interact with them. This is what I see:
I have tried logging out, restarting, uninstalling 3.9 (so there are no current versions of python), and restarting Cortana in task manager. An old post on Microsoft recommended renaming this file: C:\Users\Username\AppData\Local\Packages\Microsoft.Windows.Cortana_cw5n1h2txyewy on reboot, but I don't believe this file exists anymore. I would have just ignored it, but it seems to conflict with 3.9.
I have had this same problem. I cannot get version 3.8 to get off the start window, however, I have resolved the conflict. I first, after uninstalling 3.8 normally, I found the leftover files (the manual) in the C:\Users\CHfar\AppData\Local\Programs\Python pathway. I deleted all the 3.8 files. I also uninstalled python 3.9.1.
After starting the install process again, I made sure to click add python 3.9 to PATH.
To check to see if everything was correct I typed in 'env' into the search at the windows start button and clicked on edit environment variables for your account. I went to Path and clicked Edit. Make sure the python pathways are at the top.
In the command prompt, I typed in C:\...>python --version
to see if it was installed correctly.

0x80070643 error while installing Python 3.6

I'm actually using Python for an audio steganography project but I have some troubles.
I searched this error code on the forum, but I found things about SQL installations and not Python.
I'm trying to re-install Python 3.6.5 after an uninstall, because of a bug with pip.
I installed Python 2.7, Python 3.6.5, Python with VS 2017, before uninstall it because it wasn't working.
However, when I'm runing the installer as an administrator, hit "customize installation", tick everything excpet "balblalblabal (this requires VS 2015 or later)", and click on "install", it tells me that :
.
I realy need Python to work and I'm now stuck ...
If anybody here could help me, it would be nice !
Thanks all,
maleik.
PS : I have the log for you :*
The log link
I found this in the log file which you have attached. Try cleaning the registry with CC cleaner and give it a try. If it still doesn't work, try installing python with web installer Python Web Installed 3.6.5.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to install MSI package.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package.
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to configure per-machine MSI package.
[2610:03A4][2018-12-05T20:46:18]i319: Applied execute package: core_AllUsers, result: 0x80070643, restart: None
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package
I installed python from Microsoft store after facing this problem and it magically got installed without any error as it may have directly been installed. I don't know but try if it eorks for you too.
You need to run the installation as a local administrator.
I had the same problem installing Python version 3.9 for the first time on my Windows 10, as this same problem happens to many users trying to install Python, the best solution I accidentally, just like #MANAN AGGARWAL discovered trying to check if I already had a version of Python installed on my computer by the DOS Command Prompt, was:
Open the DOS Command Prompt (cmd) and dictate "python": if a screen shows you a version, it's clearly not the first time you've installed Python, so if you want to upgrade you should try: https: / /www.delftstack.com/en/howto/python/how-to-update-python/ But if you've never installed any version of Python, the solution lies in updating your operating system to the latest version through Windows Update, and open the command prompt and type Python, or go directly to the Microsoft Store and search for Python followed by its latest version. It works without error.
** If by chance it does not automatically install on your PC after downloading, click "install on my devices" and select your computer name.
Why can't I install Python directly from the website file? Please note that when trying to install any software/applications from outside Microsoft's trusted locations, there are high chances of user settings interfering with the installation. When coming, for example, from the Microsoft Store, a chance of success is much greater, even without having problems related to User Permission Settings.
Another important thing to point out here is that installing a lot of software from outside Microsoft's trusted platforms can cause you to change some user permissions which can have positive effects with some software and negative effects with others, even with security your own system if you don't know what you're doing.
it's simple , Try Lower Version Like 'Python 3.6' but Download web install.
install it , then install last python version.
your python will update.
I've faced same/similar problem with installing Python 3.9.12 in a clean Windows 8.1 64-bit (VirtualBoxed test environment).
I thought the issue could have been fixed in a newer version of Python, but the freshest 3.10.10 fails with same issue.
The original log isn't available any longer, but luckily it is quoted in another answer, and the following line reveals the real problem:
Applied execute package: core_AllUsers, result: 0x80070643, restart: None
My log looks the same, and if you scroll the log up, you'll discover that core_AllUsers is a UCRT MSI-installer, which is downloaded from Python site (for 3.10.10 64-bit the link may look like https://www.python.org/ftp/python/3.10.10/amd64/ucrt.msi).
If you download it manually (Python installer is smart enough to do a cleanup even if it fails, so you won't find this MSI in a local cache) and run, it will probably crash. And if it is your case, I have a simple solution - just install update KB2999226 (Update for Universal C Runtime) for your OS, which you can download from Microsoft.
I also faced the similar issue. What the trick worked for me is I installed it for the individual user (as earlier installation was for the all users).
So earlier if one has installed it for the all users then install it for the specific user and vice versa.
I know this is not the resolution of the error faced. However, this approach will install Python which is the main motive to achieve.
I encountered the same issue after installing a fresh Windows 8.1 on my PC.
I solved that by using the Python v3.9 web installation file which you can find here.
However, you can choose any other version that has a web installation file
Note: You need internet connection to use this method.

Python GDal installation

Having some problems with Gdal installation with python 2.7 on Windows 7 32bit. I am running MSVC 2010. I have followed the instruction from the blog website
http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/
The installation is fine. At the end of it, I am able to run ogr2ogr in the MS-DOS and have gotten the similar screen as listed in the blog.
However, when I am trying to use the command "import osgeo" on the Python IDLE GUI shell. A series of error message is released, reading like the following
"DLL error:.........."
I believe that this might mean that the python binding is of wrong version. I have cleared up my installation by removing the following: Python-Gdal binding, Gdal, Python 2.7
After removing them, I have retried my installation with Python 3.2.3 instead and loaded the Gdal package and python binding accordingly. However, the same error returns.
Is there any intermediate steps that I could take to verify the installation. Any other advice I could have to have the bindings installed? Or is my reinstallation method correct?
I have tried to install FWTools too. It doesnt seem to work either. I have run the Python shell from EV-shell and type in "import osgeo". Have gotten the message "no module exist...."
Thanks
Get the precompiled gdal from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
I have some other notes on setting up postgres and postgis 2.0 here if you need it:
http://monkut.webfactional.com/blog/archive/2012/5/2/using-django-14-with-gdal-19-and-postgis-20/

Can't install pywin32..?

I tried to install pywin32 via the 32 bit python 2.6 msi installer and got this error:
I have no idea why, so I went and installed python 2.7 and tried again with the pywin32 2.7 installer and got an error that amounted to another error (Sorry for not being more specific, but python 2.7 is now gone from my computer. The error was incredibly vague and had "Error:" and then no more text after it if I recall correctly).
I can't figure out what this error means, however. I wanted to use pyinstaller but it requires pywin32, so after I couldn't install pywin32 I tried py2exe and got this error:
*** finding dlls needed ***
error: pywintypes26.dll: No such file or directory
So I'm pretty sure I need pywin32. Anyone have any ideas?
I don't know the cause, but I got the same error (only with different line numbers, maybe from a different version of pywin32), and this fix worked for me, installing on windows 7:
Extract the installer file to a directory using the free 7zip (or similar) program
Copy everything in the PLATLIB directory to C:\Python26\Lib\site-packages
Open a command prompt to the SCRIPT directory and type:
python pywin32_postinstall.py -install
You must have Python already installed (perhaps obviously) and in your windows PATH environment variable for this to work. You can also try the testall script in that PLATLIB directory (though for me, that hung). After doing this, I was able to import pywin32 modules from the Python IDLE just fine.
(Trying to run the installer in compatibility mode didn't solve this for me.)
I did the following and worked for version 2.7 (I did not try 3.0 and up, but it should work too):
Move the .exe file into the platlib (C:\Python27\Lib\site-packages)
Run as admin the .exe file and you should be Good :)
If you want to check if it worked just do: import win32api and run it.
As of when I wrote this (Feb'12), IMO Python 2.5 is the most stable version of Python on Windows. I suggest you try re-installing everything on Python 2.5. I use it on Windows 7 and I don't have any issues whatsoever

Python Not Enabled In Vim

I am trying to get the Xdebug vim plugin to work which depends on python. Here is my environment: Windows 7 Professional 64bit, Vim 7.3. I got everything set up for this plugin, but when I hit F5 nothing happens. I found some blogs describing some additional steps to get this working on Windows. All of them stressed making sure the correct version of Python is installed correctly. I looked at the plugin code in the debugger.vim file and close to the top it checks to see if python is available and exits if it is not. I inserted an echo command to tell me if python is not installed, and sure enough a message box pops up informing me of such. Here is the modified code:
if !has("python")
echo 'python NOT loaded'
finish
endif
According to this blog http://phphints.wordpress.com/2008/08/20/add-debug-support-to-vim/ I need to install the version of python that includes the dll vim is looking for when I run the version command from vim. Mine reports:
-DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DDYNAMIC_PYTHON3_DLL=\"python31.dll\"
So I installed the 64 bit version of python 2.7.1. Same result even though python27.dll is in the System 32 folder. I also tried adding the location of python.exe to the PATH, but this did not help. I also tried installing the 64 bit version of python 3.1.3 but this did not help. Any ideas?
I made the following changes, and now python is working (The conditional echo statement is never reached). I uninstalled Vim and re-installed it. I uninstalled the 64 bit versions of Python 2.7.1 and 3.1.3. I installed the 32 bit version of python 2.7.1.
I am guessing the change that made the difference is using the 32 bit version of Python 2.7.1 since I am using the 32 bit version of Vim. What do you think(leave a comment)?
This may not be the direct solution to your problem, but you need to make sure the vim executable compiled with Python support.
You can check what options are compiled by running :version in the vim command line.
Also, as far as I know, python3 support only added after vim7.3. If you have vim7.2, your best bet is to get python 2 working.

Categories

Resources