【问题标题】:Can't Install Python Libraries with C Dependencies无法安装具有 C 依赖项的 Python 库
【发布时间】:2016-02-17 14:08:32
【问题描述】:

我目前正在使用 PyCharm Community 5.0.3 在 Windows 8.1 上运行 Python 3.4,当我尝试安装具有 C 依赖项的库(即 pymssql)时遇到以下错误:

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)

我已经对类似情况进行了各种 Stack Overflow 响应,但未能找到可行的答案,因为大多数问题都是针对 Python 2.7 的。我发现的主要反应是重新下载 Visual Studio 10,我在网上根本找不到。

对此问题的任何见解都会很棒。

【问题讨论】:

标签: python python-3.x visual-c++ pymssql


【解决方案1】:

首先,您可以从link 下载 Microsoft Visual 2013 Redistributable Packages

您还可以将 Mingw 用作 python 2.x 和 3.x 的 编译器

查看此文档:https://docs.python.org/2.7/install/#gnu-c-cygwin-mingw

这允许你有编译器来为你的 python 构建你的扩展,使用 mingw 作为 python 的编译器你必须:

1-将mingw32安装到**C:\programs\mingw**

2-将 mingw32 的 bin 目录添加到您的环境变量中:将 c:\programs\MinGW\bin; 附加到 PATH

3-编辑(如果不存在则创建distutils.cfg 文件位于 C:\Python2\Lib\distutils\distutils.cfg 成为:

[build]
compiler=mingw32

现在运行 easy_install.exe 来安装任何使用 c 或 c++ 扩展的模块 :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-13
    • 1970-01-01
    • 2021-04-04
    • 2016-12-13
    • 1970-01-01
    • 2016-02-06
    • 2020-05-26
    • 1970-01-01
    相关资源
    最近更新 更多