在 Windows 10 和 python 3.7 64 位上安装 fancyimpute 时出错

Posted

技术标签:

【中文标题】在 Windows 10 和 python 3.7 64 位上安装 fancyimpute 时出错【英文标题】:error in installation fancyimpute on windows 10 and python 3.7 64 bit 【发布时间】:2020-04-11 19:17:52 【问题描述】:

我正在尝试使用 pip install 和 conda install 安装 fancyimpute 并通过下载软件包并安装它,但所有这些都失败了 当使用 pip isntall 时,它给了我以下错误

pip install fancyimpute

C:\Windows\system32>pip install fancyimpute
Processing c:\users\norah mahmoud\appdata\local\pip\cache\wheels\0e\65\31\fff6a8fa9d1df4c6204f5a9059340347d2085b971b67d3f0a0\fancyimpute-0.5.4-cp37-none-any.whl
Requirement already satisfied: keras>=2.0.0 in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from fancyimpute) (2.3.1)
Requirement already satisfied: tensorflow in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from fancyimpute) (2.0.0)
Requirement already satisfied: scipy in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from fancyimpute) (1.3.2)
Requirement already satisfied: numpy>=1.10 in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from fancyimpute) (1.17.4+mkl)
Requirement already satisfied: scikit-learn>=0.21.2 in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from fancyimpute) (0.21.3)
Collecting cvxpy>=1.0.6
  Using cached https://files.pythonhosted.org/packages/d9/ed/90e0a13ad7ac4e7cdc2aeaefed26cebb4922f205bb778199268863fa2fbe/cvxpy-1.0.25.tar.gz
Requirement already satisfied: knnimpute in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from fancyimpute) (0.1.0)

Collecting ecos>=2
  Using cached https://files.pythonhosted.org/packages/b9/3a/59aa93b573a22fda44402383aeddcc2a081c31e61080af3da9d11855c77a/ecos-2.0.7.post1.tar.gz
Collecting scs>=1.1.3
  Using cached https://files.pythonhosted.org/packages/f2/6e/dbdd778c64c1920ae357a2013ea655d65a1f8b60f397d6e5549e4aafe8ec/scs-2.1.1-2.tar.gz
Requirement already satisfied: multiprocess in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from cvxpy>=1.0.6->fancyimpute) (0.70.9)
Requirement already satisfied: requests<3,>=2.21.0 in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow->fancyimpute) (2.22.0)
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\norah mahmoud\appdata\local\programs\python\python37\lib\site-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow->fancyimpute) (0.16.0)
Requirement already satisfied: markdown>=2.6.8 in c:\users\norah IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include" /EHsc /Tpcvxpy/cvxcore/src/cvxcore.cpp /Fobuild\temp.win-amd64-3.7\Release\cvxpy/cvxcore/src/cvxcore.obj
  cvxcore.cpp
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include\crtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for cvxpy
  Running setup.py clean for cvxpy
  Building wheel for ecos (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\norah mahmoud\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NORAHM~1\\AppData\\Local\\Temp\\pip-install-eumy9bu0\\ecos\\setup.py'"'"'; __file__='"'"'C:\\Users\\NORAHM~1\\AppData\\Local\\Temp\\pip-install-eumy9bu0\\ecos\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\NORAHM~1\AppData\Local\Temp\pip-wheel-093ilbsb' --python-tag cp37
       cwd: C:\Users\NORAHM~1\AppData\Local\Temp\pip-install-eumy9bu0\ecos\
mahmoud\appdata\local\programs\python\python37\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for ecos
  Running setup.py clean for ecos
  Building wheel for scs (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\norah m

  ----------------------------------------
  ERROR: Failed building wheel for scs
  Running setup.py clean for scs
Failed to build cvxpy ecos scs

我该如何解决这个错误 任何帮助将不胜感激

【问题讨论】:

这个问题已经回答了:***.com/questions/44822824/…希望这有帮助! 这个已经回答了:) 看看this answer 【参考方案1】:

通过手动下载相应的.whl文件(Python版本和Windows架构)解决了问题,下载whl格式的ecoshere。导航到下载的文件(在终端中)并运行:

pip install ecos-2.0.7.post1-cp37-cp37m-win_amd64.whl 

【讨论】:

哪个问题?因为不止一个。【参考方案2】:

我想首先说明 Anaconda 频道上的软件包已经构建,因此不需要构建步骤(也许[SO]: Installing pygraphviz on Windows 10 64-bit, Python 3.6 可能有用)。在这种情况下:

_ecos.cp37-win_amd64.pydECoS 存档中(以支持我的声明) 另一方面,CVXPy 未找到(可能我没有设置正确的频道),所以可能这就是您无法安装它的原因

这是[SO]: Failed building wheel for fancy impute using pip install 的欺骗这一事实(如 cmets 所示)是值得商榷的,这取决于人们认为是什么问题:

    效果:(C) 编译错误阻止 .whl 构建(并因此安装) 根本原因:#1 处编译错误的性质。

选择#1. 的人会将此问题视为重复问题,而选择#2. 的人则不会。作为旁注,我认为自己属于后一类。

不管任何人的选择(从上面的 2 个选项中),从 [UCI.LFD]: Unofficial Windows Binaries for Python Extension Packages 和 pip install 下载 .whl 都可以通过 (this) 问题

由于我属于第 2nd 类别,因此我进行了更多调查。在另一个问题上,错误(未声明的标识符)在(旧版本的)ECoS 代码中,而这里 CVXPy 和 ECoS 构建失败,因为一些(标准)头文件没有找到:

corecrt.h io.h

这些都是 UCRT (Windows SDK) 的一部分。更多详情,请查看[SO]: How to circumvent Windows Universal CRT headers dependency on vcruntime.h (@CristiFati's answer) 。

由于您没有这 2 个文件(很可能还有许多其他文件),您的 VStudio 2017Enterprise)安装似乎已损坏(或不完整 - 如果这有道理的话)。

尝试修复您的 VStudio 安装,当您在安装程序中时,确保您拥有(至少)一个 Windows 10 SDK 组件选择:

请注意,您可能需要重新启动机器(在极少数情况下)才能使更改生效。如果不能解决问题,您可以考虑重新安装 VStudio

在我这边(VStudio 2017 社区)一切都很顺利(显然,我已经安装了(正确的)CVXPy):

[cfati@CFATI-5510-0:e:\Work\Dev\***\q059405542]> sopr.bat
*** Set shorter prompt to better fit when pasted in *** (or other) pages ***

[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.07.06_test0\Scripts\python.exe" -m pip install fancyimpute
Collecting fancyimpute
  Downloading fancyimpute-0.5.4.tar.gz (20 kB)

...

  Building wheel for fancyimpute (setup.py) ... done
  Created wheel for fancyimpute: filename=fancyimpute-0.5.4-py3-none-any.whl size=26391 sha256=e182e267e4da0c6278740c8fc7897ee5cd33c18bb619116fe1113a52b3c90110
  Stored in directory: c:\users\cfati\appdata\local\pip\cache\wheels\c8\76\2f\b80a903a4dde1510d086aa6b1e7328fe8555cbcbc4350fc707
  Building wheel for knnimpute (setup.py) ... done
  Created wheel for knnimpute: filename=knnimpute-0.1.0-py3-none-any.whl size=11358 sha256=6191f1165de669a72309d4a1c68ebe4515a2d2d7772a38d8f67e0a5c762212aa
  Stored in directory: c:\users\cfati\appdata\local\pip\cache\wheels\72\21\a8\a045cacd9838abd5643f6bfa852c0796a99d6b1494760494e0
  Building wheel for ecos (setup.py) ... done
  Created wheel for ecos: filename=ecos-2.0.7.post1-cp37-cp37m-win_amd64.whl size=68219 sha256=ada998350dcd3997004a9d9fe4263c1b14bb729c27f7e61a03a46895281bbf4d
  Stored in directory: c:\users\cfati\appdata\local\pip\cache\wheels\70\e7\fd\4a4f957fc18a0f0407ca4b331c51e6a469c92efec58f732edf
  Building wheel for scs (setup.py) ... done
  Created wheel for scs: filename=scs-2.1.2-cp37-cp37m-win_amd64.whl size=119179 sha256=8cd6a5377730b13f9b468f2f6e5ed4be8028109b8990100e198efe90696d2ac0
  Stored in directory: c:\users\cfati\appdata\local\pip\cache\wheels\bc\e9\2d\41c52bfaefbbbee5b3c6c189e168039f6ac9b40fa2e14fe96d
Successfully built fancyimpute knnimpute ecos scs

...

作为结论,问题中的错误只是另一个(更深层次的)错误的表现,它肯定会在其他情况下“露出牙齿”。

【讨论】:

以上是关于在 Windows 10 和 python 3.7 64 位上安装 fancyimpute 时出错的主要内容,如果未能解决你的问题,请参考以下文章

在 Windows 10 和 python 3.7 64 位上安装 fancyimpute 时出错

烧瓶套接字 io 不工作(Windows 7 和 10)anaconda 和 python 3.7

cx_Freeze 错误模块 SSL 不可用 Python 3.7 Windows 10

Windows系统 - python3(3.7以上版本)部署自动化框架robot framework

Win10 安装Tensorflow (Python 3.7)

Pyinstaller 在 python 3.7 中不起作用(找不到模块“编码”)