以下是我收到的消息。为了它的价值,我打开了我的注册表并注意到没有2.7
文件夹,PythonCore
直接进入InstallPath
。有什么想法吗?
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
答案 0 :(得分:7)
我遇到了同样的问题,谷歌搜索并设法解决了解决方案。这是我遇到的。
Python似乎更新HKEY_CURRENT_USER下的注册表,有些安装在HKEY_LOCAL_MACHINE下查找python。
我遇到的有用资料
假设您的python安装位于C:\python27
来自这篇Restoring Your Python Registry in Windows文章 -
17 - 21
行复制,
[HKEY_CURRENT_USER \ SOFTWARE \的Python \ Pythoncore \ 2.7 \安装路径]
@ =&#34; C:\ python27&#34;
[HKEY_CURRENT_USER \ SOFTWARE \ Python的\ Pythoncore \ 2.7 \ PYTHONPATH] @ =&#34; C:\ python27; C:\ python27 \ LIB \; C:\ python27 \的DLL \&#34;
fix_python.reg
或您想要的任何内容:)
希望它有所帮助。
答案 1 :(得分:1)
我正在使用Windows 10并且必须手动添加它。这是我所做的修改的导出:
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\\"