构建Bottleneck出错导致构建失败错误

3

我正在尝试通过在命令提示符中执行 pip install bottleneck 命令来安装 bottleneck,但是我一直收到以下错误信息:

    ERROR: Command errored out with exit status 1:
   command: 'c:\users\benito\appdata\local\programs\python\python36\python.exe' 'c:\users\benito\appdata\local\programs\python\python36\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\Benito\AppData\Local\Temp\tmp3cb_deoe'
       cwd: C:\Users\Benito\AppData\Local\Temp\pip-install-hrd3bsvr\bottleneck
  Complete output (51 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\_pytesttester.py -> build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\_version.py -> build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\__init__.py -> build\lib.win-amd64-3.6\bottleneck
  creating build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\autotimeit.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\bench.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\bench_detailed.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\__init__.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  creating build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\move.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\nonreduce.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\nonreduce_axis.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\reduce.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\__init__.py -> build\lib.win-amd64-3.6\bottleneck\slow
  creating build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\bn_config.py -> build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\bn_template.py -> build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\__init__.py -> build\lib.win-amd64-3.6\bottleneck\src
  creating build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\input_modification_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\list_input_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\memory_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\move_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\nonreduce_axis_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\nonreduce_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\reduce_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\scalar_input_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\util.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\__init__.py -> build\lib.win-amd64-3.6\bottleneck\tests
  UPDATING build\lib.win-amd64-3.6\bottleneck/_version.py
  set build\lib.win-amd64-3.6\bottleneck/_version.py to '1.3.1'
  running build_ext
  running config
  compiling '_configtest.c':



  int __attribute__((optimize("O3"))) have_attribute_optimize_opt_3(void*);

  int main(void)
  {
      return 0;
  }

  error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
  ----------------------------------------
  ERROR: Failed building wheel for bottleneck
  Running setup.py clean for bottleneck
Failed to build bottleneck
ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly

我还安装了Microsoft Visual C++ 14.0,并重启了电脑。我启动了这个程序并在程序中完成了相同的操作,但是我仍然遇到了同样的错误。我也运行了pip install wheel,然后运行了pip install bottleneck,但仍然收到了相同的错误提示。此外,我使用的是Python 3.6。


你是如何安装Microsoft Visual C++ 14.0的?看起来这仍然是问题所在,对吧?参见:https://dev59.com/uF0a5IYBdhLWcg3w48BP。 - AMC
非常感谢。这对我有用,对于混淆我感到抱歉。 - benito.cano
这个回答解决了你的问题吗?需要Microsoft Visual C++ 14.0 (无法找到vcvarsall.bat) - AMC
3个回答

1

我也在尝试在Windows上安装Pycaret时遇到了同样的问题。报错信息如下:

ERROR: Failed building wheel for bottleneck
Failed to build bottleneck
ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly

阅读输出,似乎安装过程无法安装瓶颈,因此您需要手动进行安装。 Pip在执行此操作时失败了,因此因为我正在使用Anaconda环境,所以使用conda install是可行的方法。同时安装p5py和pep517也是个好主意。
我可以通过以下步骤解决问题:
1. conda install bottleneck 2. pip install p5py 3. pip install pep517 4. pip install pycaret

1
我通过从该网站手动安装瓶颈库并使用相应的wheel文件来使其正常工作:www.lfd.uci.edu/~gohlke/pythonlibs/

只需下载适用于您Python版本的文件(在我的情况下为Bottleneck-1.3.2-cp38-cp38-win_amd64.whl)并进行安装:

pip install C:\Users\...

1

首先需要安装PyPI,然后安装pyinstaller。

pip install PyPI
pip install pyinstaller

PyPI安装截图

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接