Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I cannot install numpy because it can't find python 2.7, althought I have installed python

Tags:

python

numpy

I cannot install numpy because it can't find python 2.7, althought I have installed python.

I have message: "Python version 2.7 required, which can't find in registry"

Do have a solve of my problem?

like image 882
kspacja Avatar asked Mar 13 '12 12:03

kspacja


People also ask

Does Python 2.7 support NumPy?

NumPy 1.16. 0 Release Notes. This NumPy release is the last one to support Python 2.7 and will be maintained as a long term release with bug fixes until 2020. Support for Python 3.4 been dropped, the supported Python versions are 2.7 and 3.5-3.7.

Why does my Python not have NumPy?

Python numpy not found or no module named 'numpy' error appears when the module is not installed in the current working environment. Install the module using pip or conda to fix this issue. but make sure that you have installed it in current working environment.

Is NumPy already installed with Python?

Go to Python -> site-packages folder. There you should be able to find numpy and the numpy distribution info folder. If any of the above is true then you installed numpy successfully.


1 Answers

This is not uncommon with installers (e.g. Numpy) that depend on or look for a previously installed 64 bit core application (e.g. Python x64). The problem and solution are easy to explain.

PROBLEM IMHO this is an error on the part of the developer of the already-installed 64 bit applicaiton by placing the registry entry in the 32 bit node rather than (or in addition to) the 64 bit node. Actually, the developer of the installer could also code it to look in both locations as well, rather than just assuming the 64 bit application registry entry will be in \Wow6432Node, as a way of avoiding this problem of the original developer's oversight; however, if the installer bases its decision on whether the app is 32- or 64 bit based on the location of the registry entry (not a good idea), this could be problematic.

Occassionally with 64 bit applicaitons a registry entry will be created in...

HKLM\SOFTWARE\[applicaion name] 

However, a corresponding registry entry is not created in...

HKLM\SOFTWARE\Wow6432Node\[application name] 

SOLUTION The easiest way to resolve this with any applicaiton is to...

  1. Open the registry editor (START --> RUN --> regedit)
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ [applicaiton name] (in this case "Python")
  3. Right click on the applicaiton ("Python")
  4. Select "Export" and save the file somewhere as "[application name].reg" ("Python.reg")
  5. Open the saved file with your editor of choice (I like Notepad++)
  6. On each entry right after "[HKEY_LOCAL_MACHINE\SOFTWARE" but before \ [applicaiton name] ("\Python"), add "\Wow6432Node" (without the quotes, obviously)
  7. Save the edited file as "[application name]_64.reg" (Python_64.reg")
  8. Close the editor and double-click on the newly created file, answer "Yes" to the Registry Editor verification popup.

Now you should have duplicate entries in HKLM\SOFTWARE\ [applicaiton name] and HKLM\SOFTWARE\Wow6432Node\ [applicaiton name]. Alternatively, you could manually create all the missing entries under HKLM\SOFTWARE\Wow6432Node\ [applicaiton name] to match what is in HKLM\SOFTWARE\ [application name], but that's really the long way around.

When you re-run the Numpy installer, it will now properly detect your 64 bit installation of Python.

CAVEAT There is a caveat to all this.

The duplicate entries in HKLM\SOFTWARE and HKLM\SOFTWARE\Wow6432Node are not a problem and will not affect normal operation of an application; however, as the developer missed creating the Wow6432Node registry entry, it's unlikely that any future updates that modify the registry entries will be populated in both locations. You may occassionally have to either perform this operation again or manually add new registry entries to the Wow6432Node in order to keep them consistent. An example where you might run into this is with the installation of Python modules that add an entry under HKLM\SOFTWARE\Python\PythonCore\2.x\Modules\ . You can export just the added entry and edit the .reg file to include "\Wow6432Node" only, export the entire \Python node and edit all entries (importing the edited .reg file will overwrite existing entries), or just manually add the new entry - whatever seems simpler to you.

like image 185
RMWChaos Avatar answered Sep 16 '22 16:09

RMWChaos