安装mysql-python(Windows) [英] Install mysql-python (Windows)

查看:87
本文介绍了安装mysql-python(Windows)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了几个小时试图让Django在我的电脑上工作。问题是我无法安装mysql-python包。我正在运行Windows 7 64位。这是我试过的:


  1. 我已经下载了easy_install

  2. 我已经下载了Cygwin64能够运行Linux命令(Win cmd驱使我疯狂)

  3. 我输入了:easy_install mysql-python(给我一个错误消息,说它找不到vcvarsall.bat)

  4. 我已经下载了Visual Studio 2010.然而,我卸载它,因为我发现我已经有一些其他版本(它没有解决问题)

我已经把这个问题像一千次,所以如果有人能帮我,我会非常感激的。感谢提前!



编辑:我发现这一点: https://pypi.python.org/pypi/MySQL-python/1.2.5 。这是否意味着我无法使用python 3.3运行Django?如果有一个.exe文件,那么为什么要去处理所有这些工作?

解决方案

你将要要以这种方式将Python添加到您的路径环境变量中。转到:


  1. 我的电脑

  2. 系统属性

  3. 高级系统设置

  4. 在高级选项卡下,单击说明环境变量的按钮

  5. 然后在系统变量下,您将要添加/更改以下变量: PYTHONPATH 路径。这是一个粘贴我的变量的样子:

PYTHONPATH

  C:\Python27; C:\Python27\Lib\site-packages; C:\Python27\Lib; C:\Python27 \DLLs; C:\Python27\Lib\lib-tk; C:\Python27\Scripts 

路径

  C:\Program Files\MySQL\MySQL Utilities 1.3.5\; C:\Python27; C:\Python27\Lib\site-包; C:\Python27\Lib; C:\Python27\DLLs; C:\Python27\\ \\ Lib\lib-tk; C:\Python27\Scripts 

您的路径可能不同,所以请调整它们,但是这个配置对我有用,你应该可以在进行这些更改后运行MySQL。


I've spent hours trying to make Django work on my computer. The problem is that I can't install the mysql-python package. I'm running Windows 7 64bit. This is what I've tried:

  1. I have downloaded easy_install
  2. I have downloaded Cygwin64 to be able to run Linux commands (Win cmd was driving me crazy)
  3. I have typed in: easy_install mysql-python (gave me an error message saying it can't find vcvarsall.bat)
  4. I have downloaded Visual Studio 2010. However, I uninstalled it since I found out that I had some other version of it already (it didn't solve the problem)

I have googled this problem like a thousand times, so I would be very grateful if someone could help me. Thanks in advance!

EDIT: I discovered this: https://pypi.python.org/pypi/MySQL-python/1.2.5. Does this mean I can't run Django with python 3.3? And why bother to go through all this work if there is an .exe-file out there?

解决方案

You're going to want to add Python to your Path Environment Variable in this way. Go to:

  1. My Computer
  2. System Properties
  3. Advance System Settings
  4. Under the "Advanced" tab click the button that says "Environment Variables"
  5. Then under System Variables you are going to want to add / change the following variables: PYTHONPATH and Path. Here is a paste of what my variables look like:

PYTHONPATH

C:\Python27;C:\Python27\Lib\site-packages;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\Python27\Scripts

Path

C:\Program Files\MySQL\MySQL Utilities 1.3.5\;C:\Python27;C:\Python27\Lib\site-packages;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\Python27\Scripts

Your Path's might be different, so please adjust them, but this configuration works for me and you should be able to run MySQL after making these changes.

这篇关于安装mysql-python(Windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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