Set-ItemProperty message when importing virtualenvwrapper
Asked Answered
A

2

5

Here is the message that I get. For what it's worth, I opened my registry and noticed that there is no 2.7 folder, PythonCore leads straight into InstallPath . Any ideas?

Set-ItemProperty : Cannot find path 'HKCU:\Software\Python\PythonCore\2.7\InstallPath' because it does not exist.
At C:\Users\...\Documents\WindowsPowerShell\Modules\virtualenvwrapper\win.psm1:127 char:21
+     set-itemproperty <<<<  -path "HKCU:/Software/Python/PythonCore/$pyVer/InstallPath" -name "(default)" -value $pyBa
se
    + CategoryInfo          : ObjectNotFound: (HKCU:\Software\...2.7\InstallPath:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Set-ItemProperty : Cannot find path 'HKCU:\Software\Python\PythonCore\2.7\PythonPath' because it does not exist.
At C:\Users\...\Documents\WindowsPowerShell\Modules\virtualenvwrapper\win.psm1:128 char:21
+     set-itemproperty <<<<  -path "HKCU:/Software/Python/PythonCore/$pyVer/PythonPath" -name "(default)" -value "$pyBa
se\Lib;$pyBase\DLLs;$pyBase\Lib\lib-tk"
    + CategoryInfo          : ObjectNotFound: (HKCU:\Software\...\2.7\PythonPath:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand
Avaunt answered 27/1, 2014 at 21:23 Comment(1)
Any luck solving this? I'm Having the same issue.Isochronal
I
7

I had the Same issue, googled around and managed to solve the solution. here's what I came across.

Python appears to update the registry under HKEY_CURRENT_USER and some install look for python under HKEY_LOCAL_MACHINE.

Useful Sources I came across

So assuming your python installation is at C:\python27

From this Restoring Your Python Registry in Windows article -

  1. Copied from lines 17 - 21,

    [HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7\InstallPath]
    @="C:\python27"

    [HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7\PythonPath] @="C:\python27;C:\python27\Lib\;C:\python27\DLLs\"

  2. Paste them to a text file.
  3. Rename it to fix_python.reg or anything you wish :)
  4. Double-click the file, and follow the prompts to load the new values into the Windows Registry.
May not be the best way. But it worked fine for me.

Hope it helps.

Isochronal answered 1/4, 2014 at 14:16 Comment(1)
Thanks! Worked for me. Don't forget to include: "Windows Registry Editor Version 5.00"Guacin
C
1

I'm using Windows 10 and had to add it manually. Here's a export of the modification that I made:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Python]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\InstallPath]
@="C:\\python27"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\PythonPath]
@="C:\\python27;C:\\python27\\Lib\\;C:\\python27\\DLLs\\"
Cherubini answered 3/8, 2016 at 14:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.