Reputation: 667
I use Anaconda 1.7, 32 bit. I downloaded the correct version of the netCDF4 installer from here.
I attempted to copy the HKEY_LOCAL_MACHINE\SOFTWARE\Python folder into HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node. No luck.
Does anyone have any idea why this might be happening? Anaconda installed in the default location, C:/.
Yes, I know Anaconda has netCDF4 in the packages list - but if you look closely, it's only offered for Mac and Linux.
Upvotes: 41
Views: 139694
Reputation: 1
Check for the 32/64 bit you trying to install. both python interpreter and your app which trying to use python might be of different bit.
Upvotes: 0
Reputation: 27095
This error can occur if you are installing a package with a different bitness than your Python version. To see whether your Python installation is 32- or 64-bit, see here.
Some superpacks (e.g. for Scipy) available on SourceForge or python.org are for 32-bit systems and some are for 64-bit systems. See this answer. In Windows, uninstalling the 32-bit and installing the 64-bit version (or vice versa if your installation is 32-bit) can solve the problem.
Upvotes: 102
Reputation: 11
I had such problem. Solution was simple :
P.S. Sorry, for bad grammar.
Upvotes: 1
Reputation: 232
I think it really depends on why this error is given. It may be the bitness issue, but it may also be because of a deinstaller bug that leaves registry entries behind.
I just had this case because I need two versions of Python on my system. When I tried to install SCons (using Python2), the .msi installer failed, saying it only found Python3 in the registry. So I uninstalled it, with the result that no Python was found at all. Frustrating! (workaround: install SCons with pip install --egg --upgrade scons
)
Anyway, I'm sure there are threads on that phenomenon. I just thought it would fit here because this was one of my top search results.
Upvotes: 3
Reputation: 27594
I had the same issue when using an .exe to install a Python package (because I use Anaconda and it didn't add Python to the registry). I fixed the problem by running this script:
#
# script to register Python 2.0 or later for use with
# Python extensions that require Python registry settings
#
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/[email protected]/msg10512.html
import sys
from _winreg import *
# tweak as necessary
version = sys.version[:3]
installpath = sys.prefix
regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
installpath, installpath, installpath
)
def RegisterPy():
try:
reg = OpenKey(HKEY_CURRENT_USER, regpath)
except EnvironmentError as e:
try:
reg = CreateKey(HKEY_CURRENT_USER, regpath)
SetValue(reg, installkey, REG_SZ, installpath)
SetValue(reg, pythonkey, REG_SZ, pythonpath)
CloseKey(reg)
except:
print "*** Unable to register!"
return
print "--- Python", version, "is now registered!"
return
if (QueryValue(reg, installkey) == installpath and
QueryValue(reg, pythonkey) == pythonpath):
CloseKey(reg)
print "=== Python", version, "is already registered!"
return
CloseKey(reg)
print "*** Unable to register!"
print "*** You probably have another Python installation!"
if __name__ == "__main__":
RegisterPy()
Upvotes: 57
Reputation: 20762
Just download Python 2.7.6 Windows Installer from the official Python download page, and launch the install package.
Upvotes: 3
Reputation: 2095
Try the steps described here: http://avaminzhang.wordpress.com/2011/11/24/python-version-2-7-required-which-was-not-found-in-the-registry/
Upvotes: 6