在windows上设置django开发的virtualenv, [英] setting up virtualenv for django development on windows,

查看:199
本文介绍了在windows上设置django开发的virtualenv,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次设置一个virtualenv,当我尝试使用



$ pre> pip -E< < some virtual env>>安装MySQL-python

我得到

 文件setup_windows.py,第7行,在get_config 

serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,options ['registry_key'])

WindowsError:[错误2]系统找不到指定的文件

我猜virtualenv是停止python从访问Windows注册表不知何故,我已经尝试运行easy_install在virtualenv没有运气(我认为这是完全一样的事情),从我的主要的python安装复制网站包dir意味着蛋黄将不会看到它,



有没有人知道我是否可以cajole这个工作,或复制mysql支持所需的文件?



感谢,

解决方案

site.cfg与setup.py正在寻找错误的regsitry密钥,在文件的结尾是

 #Windows注册表MySQL的关键
#这必须设置为Windows生成工作。
#如果您有不同的版本,请只更改此选项。
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0

我浸入注册表并发现HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB\并且看到我有5.1,而不是现在报告另一个错误,但是这个问题至少解决了;




Setting up a virtualenv for the first time, when i try to install MySQL-python using

pip -E <<some virtual env>> install MySQL-python

i get

File "setup_windows.py", line 7, in get_config

    serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])

WindowsError: [Error 2] The system cannot find the file specified

I guess virtualenv is stopping python from accessising the windows registry somehow, i have tried running easy_install within the virtualenv with no luck (i assume this does exactly the same thing), copying over the site packages dir from my main python install means that yolk will not see it,

Does anyone know how i can either cajole this into working, or copy over the files needed for mysql support?

Thanks,

解决方案

site.cfg in the same dir as setup.py was looking for the wrong regsitry key, at the end of the file is

# The Windows registry key for MySQL.
# This has to be set for Windows builds to work.
# Only change this if you have a different version.
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0

I dipped into the registry and found HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB\ and saw i had 5.1 instead,

reporting another error now, but this question is solved at least ;)

这篇关于在windows上设置django开发的virtualenv,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆