pip安装MySQL-python返回无法找到vcvarsall.bat [英] pip install MySQL-python returns unable to find vcvarsall.bat

查看:130
本文介绍了pip安装MySQL-python返回无法找到vcvarsall.bat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在Windows 7上安装MySQL-python ,但是它返回无法找到vcvarsall.bat 。我使用的是Python 3.4。如何通过安装Visual Studio 2008的棘手路径,以简单的方式进行这项工作?

I have been trying to pip install MySQL-python on Windows 7 but it returns unable to find vcvarsall.bat. I am using Python 3.4. How can I make this work in a simple way without going through the thorny path of installing Visual Studio 2008?

推荐答案

As pip 用于从源代码安装,它需要编译。有两个选项来解决这个问题:

As pip is used to install from source code, it requires compilation. There are two options to resolve that:

easy_install 可以使用编译的exe文件快速安装。

easy_install is quickly able to install using compiled exe file.

这是我最喜欢的解决方案。

This is my favorite solution.

你必须首先获得车轮包装格式。许多Python包都已经有了,而最新版本的 pip 将默认安装它,旧版本必须与 - use-wheel switch。

You have to get the wheel package format first. Many Python packages have them already and latest version of pip will by default install from it, older versions must be used with --use-wheel switch.

如果车轮不存在,您将创建一个。首先安装 wheel 包,并将其用于将给定平台的现有exe或egg文件转换为轮。

If wheel does not exist, you shall create one. Install wheel package first and use it to convert existing exe or egg file for given platform to wheel.

如果,没有已经编译的版本为您感兴趣的包,没有其他解决方案,而不是编译它在某个地方。无论如何,一旦你得到它,你可以变成轮格式并从它安装。

In case, there is no already compiled version for the package of your interest, there is no other solution than to compile it somewhere. Anyway, once you get it, you can turn into wheel format and install from it.

有关一般 pip easy_install 和轮的使用和设置看到我的其他答案

For further information about general pip, easy_install and wheel usage and setup see my other answer

这篇关于pip安装MySQL-python返回无法找到vcvarsall.bat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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