33

I've downloaded Enthought Canopy EPD Free (now Canopy Express) from https://www.enthought.com/products/epd/free/ and want to install SciKit Learn (http://sourceforge.net/projects/scikit-learn/files/) which is not part of the basic EPD Free install.

When trying to install it does not find Python in the Windows registry. How do I adjust the registry so that it recognizes the Enthought version of Python?

user2621120
  • 331
  • 1
  • 3
  • 3

6 Answers6

31

I faced to the same problem. I solved it by

  1. navigate to HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\InstallPath and edit the default key with the output of C:\> where python.exe command.
  2. navigate to HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\InstallPath\InstallGroup and edit the default key with Python 3.4

Note: My python version is 3.4 and you need to replace 3.4 with your python version.

Normally you can find Registry entries for Python in HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\<version>. You just need to copy those entries to HKEY_CURRENT_USER\Software\Python\PythonCore\<version>

  • 2
    I had the same problem, and thanks to @Sameera Nandasiri, I was able to solve it. I just wanted to add a tip about copying the registry entries over. There may be a better way, but what I did is export the Python key at "HKEY_LOCAL_MACHINE\SOFTWARE\Python" to a .reg file, edited it to replace all text : "HKEY_LOCAL_MACHINE\SOFTWARE" with "HKEY_CURRENT_USER\Software" and then re-imported the reg file. – RufusVS Mar 02 '16 at 02:49
  • @RufusVS Same solution is mentioned here: https://github.com/rfk/pyenchant/issues/96 – Kaushik Acharya Nov 25 '17 at 14:06
  • Related for the Python Image Library: https://stackoverflow.com/questions/14177000/cant-install-pil-1-7#comment27485632_15802648 – lucidbrot Aug 19 '18 at 17:30
9

You can find the Python executable with this command:

C:\> where python.exe

It should return something like:

C:\Users\<user>\AppData\Local\enthought\Canopy32\User\python.exe

Open regedit, navigate to HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\<version>\PythonPath and add or edit the default key with this the value found in the first command. Logout, login and python should be found. SciKit can now be installed.

See Additional “application paths” in https://docs.python.org/2/using/windows.html#finding-modules for more details.

Tiger-222
  • 6,677
  • 3
  • 47
  • 60
  • 4
    I'm using HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\\InstallPath – Ricardo Cardona Ramirez May 21 '15 at 13:19
  • Yes, but the question is about "Enthought version of Python". I guess Enthought adds specific modules to its own Python version. – Tiger-222 May 22 '15 at 08:20
  • 1
    On my system, `InstallPath` is the location where Python is installed `C:\Python\p27` and `PythonPath` includes `C:\Python\p27\Lib;C:\Python\p27\DLLs;C:\Python\p27\Lib\lib-tk` which helps the Python runtime find modules, support DLLs, etc. I think of `PythonPath` as functioning similar to the Windows `PATH` environment variable. – Matthew Jun 15 '15 at 17:17
6

I had the same issue while trying to install bots on a Windows Server. Took me a while to find a solution, but this is what worked for me:

  1. Open Command Prompt as Administrator
  2. Copy this: reg add HKLM\SOFTWARE\Python\PythonCore\2.7\InstallPath /ve /t REG_SZ /d "C:\Python27" /f and tailor for your specifications.
  3. Right click and paste the tailored version into Command Prompt and hit Enter!

Anyway, I hope that this can help someone in the future.

Kevin Murphy
  • 426
  • 6
  • 6
  • I just want to mention that I had this written for internal documentation and instructions and thought I would share it! – Kevin Murphy Apr 28 '17 at 23:02
  • Can you explain what each of the flags mean in the `reg add` command? – clabe45 Oct 18 '17 at 17:17
  • 2
    /ve Specifies that the registry entry that is added to the registry has a null value /t Specifies the type for the registry entry /d Specifies the data for the new registry entry /f Adds the registry entry without prompting for confirmation. [Article Here](https://technet.microsoft.com/en-us/library/cc742162(v=ws.11).aspx) – Kevin Murphy Oct 18 '17 at 20:52
3

English

In case that it serves to someone, I leave here the Windows 10 base register for Python 3.4.4 - 64 bit:

Español

Por si alguien lo necesita todavía, este es el registro base de Windows 10 para Python 3.4.4:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4]
"DisplayName"="Python 3.4 (64-bit)"
"SupportUrl"="http://www.python.org/"
"Version"="3.4.4"
"SysVersion"="3.4"
"SysArchitecture"="64bit"

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\Help]

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\Help\Main Python Documentation]
@="C:\\Python34\\Doc\\python364.chm"

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\Idle]
@="C:\\Python34\\Lib\\idlelib\\idle.pyw"

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\IdleShortcuts]
@=dword:00000001

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\InstalledFeatures]

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\InstallPath]
@="C:\\Python34\\"
"ExecutablePath"="C:\\Python34\\python.exe"
"WindowedExecutablePath"="C:\\Python34\\pythonw.exe"

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\PythonPath]
@="C:\\Python34\\Lib\\;C:\\Python34\\DLLs\\"
Firegore
  • 31
  • 3
0

When installing Python 3.4 the "Add python.exe to Path" came up unselected. Re-installed with this selected and problem resolved.

Robo
  • 11
0

I installed ArcGIS Pro 1.4 and it didn't register the Python 3.5.2 it installed which prevented me from installing any add-ons. I resolved this by using the "reg" command in an Administrator PowerShell session to manually create and populate the necessary registry keys/values (where Python is installed in C:\Python35):

reg add "HKLM\Software\Python\PythonCore\3.5\Help\Main Python Documentation" /reg:64 /ve /t REG_SZ /d "C:\Python35\Doc\Python352.chm"
reg add "HKLM\Software\Python\PythonCore\3.5\InstallPath" /reg:64 /ve /t REG_SZ /d "C:\Python35\"
reg add "HKLM\Software\Python\PythonCore\3.5\InstallPath\InstallGroup" /reg:64 /ve /t REG_SZ /d "Python 3.5"
reg add "HKLM\Software\Python\PythonCore\3.5\PythonPath" /reg:64 /ve /t REG_SZ /d "C:\Python35\Lib;C:\Python35\DLLs;C:\Python35\Lib\lib-tk"

I find this easier than using Registry Editor but that's solely a personal preference.

The same commands can be executed in CMD.EXE session if you prefer; just make sure you run it as Administrator.

Erik Anderson
  • 4,915
  • 3
  • 31
  • 30