简体   繁体   English

在windows上为django开发设置virtualenv,

[英]setting up virtualenv for django development on windows,

Setting up a virtualenv for the first time, when i try to install MySQL-python using 当我尝试使用安装MySQL-python时,第一次设置virtualenv

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, 我想virtualenv阻止python以某种方式访问​​windows注册表,我已经尝试在virtualenv中运行easy_install而没有运气(我假设这完全相同),从我的主python安装复制网站包dir意味着蛋黄会看不到,

Does anyone know how i can either cajole this into working, or copy over the files needed for mysql support? 有谁知道我怎么能把这个哄骗到工作,或复制mysql支持所需的文件?

Thanks, 谢谢,

site.cfg in the same dir as setup.py was looking for the wrong regsitry key, at the end of the file is 与setup.py在同一个目录中的site.cfg正在寻找错误的regsitry密钥,在文件末尾是

# 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, 我浸入注册表,找到HKEY_LOCAL_MACHINE \\ SOFTWARE \\ MySQL AB \\,看到我有5.1,

reporting another error now, but this question is solved at least ;) 现在报告另一个错误,但这个问题至少解决了;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM