python version 2.7 required,which was not find in the registry
来源:互联网 发布:银川能源学院淘宝地址 编辑:程序博客网 时间:2024/05/02 12:04
最近在看关于DHT网络爬虫的相关东西,然而DHT爬虫好多案列都是用的python来写的。没办法就开始去学习下python。
今天在本地搭建python的时候,安装MySQL-python-1.2.4b4.win32-py2.7 出现 错误:python version 2.7 required,which was not find in the registry
当时我就吓尿了,我明明安装了python啊,还提示我没有找到。 谷歌之后才知道因为我的操作系统是win7 64位导致安装python的时候注册表没有写入对应的位置。
解决办法如下:
1.新建一个reg.py,输入如下代码
01
#
02
# script to register Python 2.0 or later for use with win32all
03
# and other extensions that require Python registry settings
04
#
05
# written by Joakim Loew for Secret Labs AB / PythonWare
06
#
07
# source:
08
# http://www.pythonware.com/products/works/articles/regpy20.htm
09
#
10
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html
11
12
import
sys
13
14
from
_winreg
import
*
15
16
# tweak as necessary
17
version
=
sys.version[:
3
]
18
installpath
=
sys.prefix
19
20
regpath
=
"SOFTWARE\\Python\\Pythoncore\\%s\\"
%
(version)
21
installkey
=
"InstallPath"
22
pythonkey
=
"PythonPath"
23
pythonpath
=
"%s;%s\\Lib\\;%s\\DLLs\\"
%
(
24
installpath, installpath, installpath
25
)
26
27
def
RegisterPy():
28
try
:
29
reg
=
OpenKey(HKEY_CURRENT_USER, regpath)
30
except
EnvironmentError as e:
31
try
:
32
reg
=
CreateKey(HKEY_CURRENT_USER, regpath)
33
SetValue(reg, installkey, REG_SZ, installpath)
34
SetValue(reg, pythonkey, REG_SZ, pythonpath)
35
CloseKey(reg)
36
except
:
37
print
"*** Unable to register!"
38
return
39
print
"--- Python"
, version,
"is now registered!"
40
return
41
if
(QueryValue(reg, installkey)
=
=
installpath
and
42
QueryValue(reg, pythonkey)
=
=
pythonpath):
43
CloseKey(reg)
44
print
"=== Python"
, version,
"is already registered!"
45
return
46
CloseKey(reg)
47
print
"*** Unable to register!"
48
print
"*** You probably have another Python installation!"
49
50
if
__name__
=
=
"__main__"
:
51
RegisterPy()
1
python reg.py
再进行MySQL-python-1.2.4b4.win32-py2.7 安装程序,就能一路顺畅了!
0 0
- python version 2.7 required,which was not find in the registry
- Python安装第三方库报错:Python version 2.7 required, which was not found in the registry.
- python error python version 2.7 required,which was not found in the registry
- 安装python插件:python version 2.7 required,which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- Python Version 2.7 required which was not found in the registry 问题解决
- Python version 2.7 required, which was not found in the registry
- Python version 2.7 required, which was not found in the registry
- python version 2.7 required,which was not found in the registry
- Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- Python version 2.7 required, which was not found in the registry.
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- Python version 2.7 required, which was not found in the registry
- 安装PIL遇到python version 2.7 required, which was not found in the registry解决办法
- 个简单C++程序反汇编解析 (Rev. 3)
- php学习笔记(十三)类型转换
- C++中引用传递与指针传递区别
- Android BLE教程(和单片机通信)
- Android 判断网络状态,网络无连接时 打开网络设置对话框
- python version 2.7 required,which was not find in the registry
- ACE_Task(任务)
- A hard puzzle
- lwIP基本栈接口层(tcp部分)
- 实验四 字符串和多维数组
- [解题报告]hdoj1249(平面分割)
- c/c++ 趣味程序百例
- hadoop介绍和体系架构
- Java集合类型详解