【问题标题】:M2Crypto error Unable to find vcvarsall.batM2Crypto 错误无法找到 vcvarsall.bat
【发布时间】:2015-06-14 13:27:26
【问题描述】:

我是使用 Python 3.4 的 windows7 64 位用户。

我安装了 M2Crypto 库。我按照此链接中提到的步骤在 Windows 上安装 M2Crypto:https://github.com/martinpaljak/M2Crypto/blob/master/INSTALL

我安装了 Microsot Visual Studio 2013 社区版。我还有 Visual c++ 2008、2010、2012 可再发行版,适用于 bith x86 和 x64。

我在 C: 目录中安装了 MinGW 和 Swigwin。

当我尝试使用 Python34/Scripts 中的此命令安装 M2Crypto 时:

pip install m2crypto

我收到如下错误:

> C:\Python34\Scripts>pip install m2crypto Collecting m2crypto   Using
> cached M2Crypto-0.22.3.tar.gz Installing collected packages: m2crypto 
> Running setup.py install for m2crypto
>     Complete output from command C:\Python34\python.exe -c "import setuptools, t
> okenize;__file__='C:\\Users\\e\\AppData\\Local\\Temp\\pip-build-sxa0uziu\\m2cryp
> to\\setup.py';exec(compile(getattr(tokenize, 'open',
> open)(__file__).read().repl ace('\r\n', '\n'), __file__, 'exec'))"
> install --record C:\Users\e\AppData\Local
> \Temp\pip-ad2ukv1d-record\install-record.txt
> --single-version-externally-managed  --compile:

然后它会复制一个文件列表。最后我得到了这个:

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

接下来是:

> Command "C:\Python34\python.exe -c "import setuptools,
> tokenize;__file__='C:\\Us
> ers\\e\\AppData\\Local\\Temp\\pip-build-sxa0uziu\\m2crypto\\setup.py';exec(compi
> le(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n',
> '\n'), __fil e__, 'exec'))" install --record
> C:\Users\e\AppData\Local\Temp\pip-ad2ukv1d-recor d\install-record.txt
> --single-version-externally-managed --compile" failed with error code 1 in C:\Users\e\AppData\Local\Temp\pip-build-sxa0uziu\m2crypto

请帮我解决这个问题。我找不到正确描述这些步骤的资源。

【问题讨论】:

  • 你需要下载 visual studio express 。它是免费提供的。
  • @poke 抱歉,这不是重复的问题。在我尝试 VC++ 之前,前一个是通用的。有人建议了一个我尝试过但没有用的链接。现在,在尝试上一个链接后,我收到了特定的错误消息。请把重复问题的标记去掉。

标签: python m2crypto


【解决方案1】:

您需要从命令提示符运行 pip install 并在搜索路径中同时使用所需的 python 程序和 Visual Studio。 (PATH)

打开 Visual C++ 命令提示符并记下

echo %PATH%

并将相关的 Visual c++ / Visual Studio 目录添加到类似于此的 python 命令提示符

设置 PATH=C:\path\to\VS;%PATH%

【讨论】:

    猜你喜欢
    • 2011-02-18
    • 1970-01-01
    • 2013-11-18
    • 2018-10-29
    • 2016-04-04
    相关资源
    最近更新 更多