Windows 7 64位下 Python 包安装的问题
来源:互联网 发布:bl是什么意思网络用语 编辑:程序博客网 时间:2024/06/10 03:15
Windows 7 64位下安装了 Python 的64位安装包,再安装其他预编译的Library就会有找不到Python的错误。 应该是有些Key没有加入到注册表中,需要运行下面的脚本修正。
## script to register Python 2.0 or later for use with win32all# and other extensions that require Python registry settings## written by Joakim Loew for Secret Labs AB / PythonWare## source:# http://www.pythonware.com/products/works/articles/regpy20.htm## modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html import sys from _winreg import * # tweak as necessaryversion = sys.version[:3]installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)installkey = "InstallPath"pythonkey = "PythonPath"pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % ( installpath, installpath, installpath) def RegisterPy(): try: reg = OpenKey(HKEY_CURRENT_USER, regpath) except EnvironmentError as e: try: reg = CreateKey(HKEY_CURRENT_USER, regpath) SetValue(reg, installkey, REG_SZ, installpath) SetValue(reg, pythonkey, REG_SZ, pythonpath) CloseKey(reg) except: print "*** Unable to register!" return print "--- Python", version, "is now registered!" return if (QueryValue(reg, installkey) == installpath and QueryValue(reg, pythonkey) == pythonpath): CloseKey(reg) print "=== Python", version, "is already registered!" return CloseKey(reg) print "*** Unable to register!" print "*** You probably have another Python installation!" if __name__ == "__main__": RegisterPy()
- Windows 7 64位下 Python 包安装的问题
- 64位win10下安装xgboost python包的教程
- 64位win10下安装xgboost python包的教程
- windows下安装64位python
- Windows下 Python 安装包的配置
- Windows下 Python 安装包的配置
- Windows下 Python 安装包的配置
- Windows下 Python 安装包的配置
- Windows下 Python 安装包的配置
- windows下 Python 安装包的配置
- Windows下 Python 安装包的配置
- Windows下Python包的pip安装
- windows下安装xgboost的python包
- windows下安装xgboost的python包
- mysql在64位windows下安装遇到的问题
- windows 7 64位 Apache httpd 最新包的安装
- windows(32位 64位)下python安装mysqldb模块
- windows(32位 64位)下python安装mysqldb模块
- jstl的学习1
- wchar类型
- 定义struct/struct定义在哪里/函数返回指针类型/指针数组与数组指针/{}里是局部定义/fabs、abs
- OIS协议分层模型
- php实现首页自动选择语言转跳(转)
- Windows 7 64位下 Python 包安装的问题
- ARDone SDK 1.8自带 Win32 Demo,使用firmware 1.7.4
- HTTP 请求返回代码含义
- CSS+DIV美化和布局-理解CSS定位与DIV布局
- linux IO行为:page cache and pdflush
- Unity如何使用Java类(理论篇)
- Android手机开发:Intent和在Activity之间传递信息
- Visual Studio常用快捷键
- testPython