so I'm trying to install MySQL-Python thru the exe found here. only problem is, whenever I open up the exe, it only wants to use a version of Python that was installed when I installed ArcGIS a while back - I need it to use my regular Python path. This is all I see when I open the installer:
The usual way to fix stuff like this is fixing your environment variables, so I've looked at them, but the ArcGIS python install isn't even listed on there - my python path points to the right version of Python, so I don't understand why this installer insists upon the ArcGIS version, even after I've deleted the entire ArcGIS python folder.
I can't change it in the installer - any ideas?
The installer in your case is looking in the registry so check the registry for the installation path, specifically check:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python
and / or
HKEY_LOCAL_MACHINE\SOFTWARE\Python
The first is for 32 bit python versions that are installed in 64 bit platforms, the 2nd is for 64 bit python.
Here is a screenshot of my registry entry:
WARNING: Take a backup of your registry if you are going to make a change and tread carefully.
Related
Upon installing Anaconda / Miniconda, there is a prompt that reads:
Where the second tick box has something about "Register Anaconda3 as my default Python 3._"
The image says 3.8 but that's just because I couldn't find an image that said 3.9.
I'm wondering what exactly this does to my system and what exactly it means by "default Python 3.8". Having selected that option, it doesn't seem like anything on my path is edited, and in fact, calling py in my terminal doesn't default to this unless I actually specify that I want Anaconda in my path, so I'm really unsure as to how this links to any other programs like mentioned, such as PyCharm.
Also, is there a point to having both Anaconda's Python 3.9 installed and having the classic Python 3.9 from the Python website installed at the same time? It seems to me like Anaconda's Python 3.9 is simply a better and more versatile version of the classic Python 3.9, but I could be wrong and am unsure as I'm really new to this. As far as I can see, however, Anaconda gives users the ability to install any other version of Python through the command line and use their own environment manager, which seems to just be an upgraded version of pip if I'm not wrong?
Windows uses a registry to manage system configuration, including entries determining what program will open files with a particular extension. It seems to me that Anaconda is offering to create a registry entry that will associate *.py files with the base Python in your installation.
I want to plot few graphs with matplotlib and I have a windows machine Firstly I need to install, so I download the file from http://matplotlib.org/downloads.html . Well, when I tried to run, it throws a pop up saying it failed to find the version 3.4 in registry. This is a bit strange because my python version is 3.4.1.
Of course, I did search through the forum. I happened to look into numpy python 3.4.1 installation: Python 3.4 not found in registry which is same as my problem. but my first question:
1) The matplotlib official page gives me a direct link to install ".exe" for windows with python version 3.4. If this is true then why this problem should occur in the first place.
2) My second question, how one can actually find whether the downloading package version is the right match for the current python version installed on local PC.
The windows .exe installer should work for all sub-versions of a given Python installation, this means that if you use the 3.4 installer it should work for 3.4.0, 3.4.1, and 3.4.2.
You need to check that you are using the correct version of the installer, 32-bit or 64-bit. The installer should match the Python version you are using, which may or may not match your system version. This is to say that if you had a 64-bit system and used 32-bit Python, you should use the 32-bit installer.
If it still doesn't work, I'd suggest you re-install Python and try again, it's possible that something has messed with your registry settings.
Originally I thought that the sub-version mattered, but in fact it does not. I raised an issue with matplotlib here and was corrected by Christoph Gohlke who maintains the .exe installations.
Incidentally (for someone reading this in the future as you know yours) if you need to find your current Python version you can simply type python -V in the command line and it'll return the details, for example mine returns:
Python 3.4.0
I had the same problem installing matplotlib-1.4.3.win-amd64-py3.4.exe on python 3.4.3: version 3.4 not found in registry. Looking in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\ there was no Python key, so matplotlib is right.
Further searching I found this SO article, Installing SetupTools on 64-bit Windows, that provided a registry script to add the necessary keys for Python 2.7. I modified the script for 3.4 and added the keys to the registry. Install of matplotlib then completed successfully. It seems the registry keys didn't get added when I installed Python 3.4.3 (sub-installer that installs registry keys is invoked at user privilege level??).
The modified registry key file I used. Save it to a text file with a .reg extension.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Python]
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore]
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4]
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\Help]
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\Help\Main Python Documentation]
#="C:\\Python34\\Doc\\python343.chm"
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\InstallPath]
#="C:\\Python34\\"
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\InstallPath\InstallGroup]
#="Python 3.4"
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\Modules]
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\PythonPath]
#="C:\\Python34\\Lib;C:\\Python34\\DLLs;C:\\Python34\\Lib\\lib-tk"
Then double click the .reg file to add the registry.
I had this problem with Python3.4.2 and went back and did a reinstall. This time I paid attention to what I was doing. While installing Python3.4.2 (or 2.7) a list of options popup. The last item on the list of options is "Add Python to path". On my installation this option was marked with an X and I assume it was on the first installation. I removed the X and continued the install of Python. When I installed numpy, it found Python in the registry and loaded okay.
Open regedit.
Find python in HKEY_LOCAL_MACHINE.
Export it to some location on your hard drive.
Open the exported file in any editor.
Replace all HKEY_LOCAL_MACHINE with HKEY_CURRENT_USER and save
the file.
Now just double click on the .reg file to add this key to registry.
If you go back to the registry using regedit, you will find python in
HKEY_CURRENT_USER as well.
I really wish 'pip install numpy' worked just like it did for python 2.7.
I have two python versions on my computer 2.7 and 3.4.1 . I have tried to install numpy by pip3.4 which resulted with vcvarsall.bat not found which i am pretty sure it is included in system path. Then i gave up downloaded numpy binary numpy-1.8.1-win32-superpack-python3.4.exe. And during the installation it tells me that numpy cannot find python 3.4 in the registry which i see that it is there also.
HKEY_LOCAL_MACHINE
-SOFTWARE
--Python
---PythonCore
----2.7
-----Help
-----InstallPath
-----Modules
-----PythonPath
----3.4
-----Help
-----InstallPath
-----Modules
-----PythonPath
so what has left me to do from here? My system is windows 7 64 bit.
There is an easier fix, remove and re-install python, in the beginning of python setup when you are asked if you want to install python for all users or just this user, select this user only.
That way the registry goes into current user by default and can be found easily by successive software packages. Tried it myself, worked like a charm.
Just a simpler option for technologically less literate people like myself.
But if you need it for multiple users on a PC then you have got to edit the registry and put it in manually, from local machine to current user. Copy it like explained in previous comments.
When installing numpy on Windows you have to ensure that you are using a .exe for the corresponding Python installation.
As you're using Python 3.4.1 you have to use an installer for Python 3.4.1. The installer that you were using was last modified on 25th March which is before 3.4.1 was released. This suggests it was for 3.4.0 and so will not work.
If you need up-to-date Windows installers for numpy (as well as a large host of other packages) they can be found here.
This steps work for me with windows 8.1 64bits
The problem is that some module installers look in the wrong place for Python version information.
For example, in the case of this one module, the installer was looking for HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.4 in the registry.
I found that my Python 3.4 installer had placed this information in HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.2 instead.
Once you know the reason, solving it is easy.
Open Registry Editor (may need administrator privilege) and export HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4 into a text file.
Open the exported .reg file in a text editor and replace the HKEY_LOCAL_MACHINE entries to HKEY_CURRENT_USER.
Add these new entries back to the registry (here is how).
The module installer should now be able to proceed without throwing the error.
ref: http://codeyarns.com/2012/04/28/python-version-not-found-in-registry-error/
I have just faced a similar issue ("numpy cannot find python 3.4 in the registry") when installing numpy-1.9.1-win32-superpack-python3.4.exe. The solution was to install the python-3.4.2.msi instead of python-3.4.2.amd64.msi.
You are trying to install the 32 bit version of numpy on a 64 bit installation of python. It doesn't look to me like you can download 64bit scipy from sourceforge so a solution is to install a 32bit version of python.
Abilio Faria gave the answer. Another answer in another thread over here
I think the changing of the registry works quite well.
Worked wonders for me... quick fix:
http://codeyarns.com/2012/04/28/python-version-not-found-in-registry-error/
I have recently been learning Python 3. I have had no problems on my netbook (32bit Windows 7) I with creating small simple programs. When I installed it on my netbook I had no problems, but now that I've been getting into it I want to install it on my desktop and I have one.
My desktop is a 64 bit OS running Windows 7. Like I did with my netbook, I went to download Python and install the 64 bit edition.
After installing it, I went to open up Python CLI and GUI and no luck. It gave me this error.
"The application was unable to start correctly (0xc000007b). Click OK to close the application"
I also tried reinstalling, but not luck.
I suspect a missing .dll but I am not completely sure. Does anyone know what is keeping me from opening Python and how do I fix it?. I want to resume my work as soon as possible.
That is the NTSTATUS error code for STATUS_INVALID_IMAGE_FORMAT. Almost invariably that means that the loaded is attempting to link a 32 bit DLL into a 64 bit process, or vice versa.
If you want to attempt to debug this then the tool of choice is Dependency Walker. You open the python.exe executable file in Dependency Walker and use the profile menu to start it up with logging of the load events. Somewhere along the way there will be a failure and you'll be able to see which module is causing that failure. That will hopefully point the way towards a resolution.
However, attempting to debug this may be a waste of time. It will probably better to uninstall the existing installation, and try to re-install. Perhaps picking a different Python distribution.
I note that you have selected a 64 bit version. Now, support for 64 bit extension modules is not as strong on 64 bit Python as on 32 bit Python. It does exist, but they modules can be harder to come by and install. You might consider installing a 32 bit Python next time round.
Please make sure that Python3.dll is the same version and the same architecture (32/64) with python.exe. I fixed this error via replacing it with 32bit version.
you should delete the old path of python in "Environment Variables" and enjoy ;)
As janne-karila mentioned, and for Python 3.5, Microsoft Visual Studio 2015 redistributable (in this case the 64 bit version)
This probably won't answer your question, but my answer is for a very specific case when you "Refresh Windows without affecting Files" to fix your Windows 8.1 PC.
If you do that, You'd get this error when you try to run Python after the windows refresh.
To fix this error, simply re-install PY at the same folder where your python was install before you refreshed windows. If you try to install it any other folder like username/appdata/... folder the PY installer would be stuck in initialization.
You may also get another error saying "api-ms-win-crt-runtime-l1-1-0.dll is missing". To fix, go to the windows.old folder and get the dll file ith the above name and paste it in the PY folder. Also like others have suggested, make sure Microsoft Visual Studio 2015 redistributable is installed.
Encountering this error after a windows refresh is so rare, that no one else seemed to have experienced according to google searches, so I though I share it here for that rare unlucky person.
Apparently the error code stands for STATUS_INVALID_IMAGE_FORMAT (source), and it looks like it's not specific to Python. You can try reinstalling the program, rebooting, running CHKDSK /r (source). It might also have something to do with the Microsoft Visual C++ redistributable package, as Janne Karila and this thread suggest.
This stackoverflow question also looks like it has some useful information.
I too faced this problem. So I uninstalled python3 64-bit version and installed 32-bit version, after that i am able to launch python3 in windows 8 successfully. (i have a 64-bit laptop).
Simply, download the last version of Microsoft Visual C++ redistributable package ..
I had the same problem ..
I have the same error found. Using dependency walker, I found tons of DLLs missing. Rather going for copying all the DLLs I went with virtual environment. It will create another environment for Python.
First, install python normally. Copy, the Python.exe path. In my case, it is
C:\Python\python
It will be used to install Python libraries. Then, using command prompt, I used pip to download and install virtualenv (Virtual environment). To do that, change the directory to where pip.exe is, which is in Scripts folder. Now, run the following to install virtualenv:
C:\Python\python pip install virtualenv
It will install Virtual environment.
Now, create a folder to hold virtual environment and change directory to that folder and run to create the following to create an environment:
virtualenv --no-site-packages [environment name]
It will create the Environment.
Now, change subdirectory to Scripts in the [environment name] folder. There is a activate file run it, in my case it is like:
C:\Python\virtualenv\env\Scripts activate
env is the [environment name] here.
If you activate it, every command will look like:
(env) C:\Python\python
This ends here. Now, you can install any python library using this. Do whatever, you want using Python.
Also, to deactivate the environment same deactivate.bat is in the scripts folder.
For me the issue was, I had installed 32 bit version on a 64 bit machine. Hope it helps someone out there.
Like many have said, Windows cannot load python.exe itself or one of its dependent DLLs because of INVALID_IMAGE_FORMAT:
python.exe is of unsupported bitness. 32bit on 64bit Windows is supported. 64bit on 32bit system is not (solution: install 32bit python, bye).
python.exe or one of its DLLs is corrupted (probably not)
one of the dependent DLLs is not of the same bitness as the EXE:
python.exe (say, 32bit) requires python*.dll (python3.dll or python27.dll). It installs that into Windows System32/SysWOW64 folder. The DLL is of correct bitness (32bit).
Something else overwrites that with 64-bit version, or places a 64-bit version somewhere in the search PATH.
When you run python.exe (32bit), Windows searches for python*.dll, and the first one it founds is the 64bit one. 32bit EXEs cannot normally load 64bit DLLs.
Typical examples:
TortoiseHg installs its own copy of python (both .exe and .dll) into its own folder and adds itself to PATH. The bitness can be different (say, 64bit) and usually matches platform bitness.
Another installation of Python with a different bitness somewhere else overwrites the DLL (it shouldn't, they have different System32s, but who knows)
Diagnostics:
Dependency Walker marks 64bit DLLs with 64bit icons. Verify that icons for python.exe and python*.dll match. Right click -> "Show full paths" to see where the DLL is taken from.
Simple solutions:
Maybe you have another, functioning copy of Python somewhere else? Check it.
Reinstall Python, preferably in the platform version (64bit for 64bit OS, 32bit for 32bit) Yeah, that's what many are saying, but now you know why this is needed.
Remove offenders from PATH. While this maaaay fix your Python, this will break the offenders and some (TortoiseHg explorer plugins) need the PATH. So maybe compromise with them and choose #2.
In my case I was installing both the 32 and 64 bit versions of the python msi. They both install to the same folder, c:\python32. I thought msi's would prevent those kinds of conflicts, but no.
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.