How to add Python to Windows registry
Asked Answered
U

6

35

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?

Untrimmed answered 26/7, 2013 at 3:8 Comment(2)
Also see the relevant PEP 514 python.org/dev/peps/pep-0514Hussey
This also fixed the problem for ReportLabAlleviate
L
33

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>

Lambart answered 22/6, 2015 at 14:15 Comment(3)
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.Madewell
@Madewell Same solution is mentioned here: github.com/rfk/pyenchant/issues/96Fraktur
Related for the Python Image Library: #14177500Mireille
B
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.

Bluet answered 8/5, 2015 at 17:17 Comment(3)
I'm using HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\<version>\InstallPathWier
Yes, but the question is about "Enthought version of Python". I guess Enthought adds specific modules to its own Python version.Bluet
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.Zelma
A
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.

Agretha answered 28/4, 2017 at 22:51 Comment(3)
I just want to mention that I had this written for internal documentation and instructions and thought I would share it!Agretha
Can you explain what each of the flags mean in the reg add command?Nitin
/ve Specifies that the registry entry that is added to the registry has a null value /t <Type> Specifies the type for the registry entry /d <Data> Specifies the data for the new registry entry /f Adds the registry entry without prompting for confirmation. Article HereAgretha
H
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\\"
Horsemanship answered 27/6, 2018 at 8:3 Comment(0)
F
0

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

Fulguration answered 29/11, 2016 at 18:24 Comment(0)
H
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.

Hobbledehoy answered 8/2, 2017 at 21:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.