无法使用C编译python包。错误2 - 无法打开包含文件:'alloca.h'?

时间:2016-07-28 13:58:22

标签: python c++ windows visual-studio-2008 pip

一切都始于“无法找到vcvarsall.bat”但我很快修复了它。之后我无法解决一些“错误2”。

已经尝试过说明herehere

  • 已安装的Visual C ++编译器Python 2.7
  • 已安装Microsoft Visual Studio 2008速成版SP1
  • 已安装适用于Windows 7和.NET Framework 3.5 SP1的Windows SDK
  • 操纵vcvarsall.bat和vsvars64

但仍然无法安装pyethash,PyYAML,scrypt。 pyethash的详细信息如下。

尝试安装Crypto,它也使用C ++库 - 它可以工作。它是否仍然看起来我有编译器问题或者我应该看看其他地方?

使用Windows 8.1 x64,python 2.7.11(v2.7.11:6d1b6a68f775,2015年12月5日,20:40:30)[MSC v.1500 64 bit(AMD64)]

使用pip

进行安装
Foundation.reInit('abide');

手动安装

PS C:\pyethereum\ethash-master> pip install pyethash
Collecting pyethash
  Using cached pyethash-0.1.27.tar.gz
Building wheels for collected packages: pyethash
  Running setup.py bdist_wheel for pyethash ... error
  Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\b19a~1\\ap
pdata\\local\\temp\\pip-build-y2vsbx\\pyethash\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().
replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d c:\users\b19a~1\appdata\local\temp\tmpwmonvkpip-wheel- --pytho
n-tag cp27:
  running bdist_wheel
  running build
  running build_ext
  building 'pyethash' extension
  error: [Error 2]

  ----------------------------------------
  Failed building wheel for pyethash
  Running setup.py clean for pyethash
Failed to build pyethash
Installing collected packages: pyethash
  Running setup.py install for pyethash ... error
    Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\b19a~1\\
appdata\\local\\temp\\pip-build-y2vsbx\\pyethash\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\b19a~1\appdata\local\temp\pip-pvhu8d-record\insta
ll-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'pyethash' extension
    error: [Error 2]

    ----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\b19a~1\\appdata\\local\\temp\\pi
p-build-y2vsbx\\pyethash\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'),
 __file__, 'exec'))" install --record c:\users\b19a~1\appdata\local\temp\pip-pvhu8d-record\install-record.txt --single-v
ersion-externally-managed --compile" failed with error code 1 in c:\users\b19a~1\appdata\local\temp\pip-build-y2vsbx\pyethash\

1 个答案:

答案 0 :(得分:1)

alloca仅在Linux中可见 这是一个严重的错误 参见https://github.com/ethereum/ethash/pull/107