简体   繁体   中英

error in installation fancyimpute on windows 10 and python 3.7 64 bit

i am trying to install fancyimpute using pip install and conda install and by download the package and install it and all of them failed when using pip isntall it gives me the following error

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

how can i fix this error any help will be appreciated

solved the problem by manually downloading the appropriate .whl file (Python version and Windows architecture), download ecos in whl format here . Navigated to the downloaded file (in terminal) and ran:

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

I want to start by stating that the packages that come on Anaconda channels are already built, so the build step is not required (maybe [SO]: Installing pygraphviz on Windows 10 64-bit, Python 3.6 might be useful). In this case:

  • _ecos.cp37-win_amd64.pyd is in the ECoS archive (to support my statement)
  • On the other hand, CVXPy was not found (maybe I don't have the right channel set), so maybe that's why you weren't able to install it

The fact that this is a dupe of [SO]: Failed building wheel for fancy impute using pip install (as indicated in the comments) is debatable, depending on what one considers to be the question:

  1. The effect: a ( C ) compile error preventing the .whl to build (and thus to install)
  2. The root cause: the nature on the compile error at #1.

Those who opt for #1. , will see this question as a duplicate, while those who opt for #2. , won't. As a side note, I consider myself part of the latter category.

Regardless of anyone's choice (from the 2 options above), downloading the .whl from [UCI.LFD]: Unofficial Windows Binaries for Python Extension Packages and pip install ing it, would get past the ( this ) problem .

Since I'm on the 2 nd category, I investigated a bit more. On the other question, the error ( undeclared identifier ) is in (an older version of) the ECoS code, while here both CVXPy and ECoS fail to build, because some (standard) header files are not found:

  • corecrt.h
  • io.h

These both are part of UCRT ( Windows SDK ). For more details, check [SO]: How to circumvent Windows Universal CRT headers dependency on vcruntime.h (@CristiFati's answer) .

Since you don't have the 2 files (and most likely many others), your VStudio 2017 ( Enterprise ) installation seems to be corrupt (or incomplete - if this even makes sense).

Try repairing your VStudio installation, and while you're in the installer, make sure you have (at least) one Windows 10 SDK component selected:

图像0

Note, that you might need to restart the machine (in some rare cases) for the changes to take effect. If it doesn't fix the problem, you could consider reinstalling VStudio .

On my end ( VStudio 2017 Community ) everything went smoothly (apparently, I already had (the right) CVXPy installed):

 [cfati@CFATI-5510-0:e:\\Work\\Dev\\StackOverflow\\q059405542]> sopr.bat *** Set shorter prompt to better fit when pasted in StackOverflow (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 ...

As a conclusion, the error in the question is just the manifestation of another (deeper) one, which would definitely "show its teeth" on other scenarios as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM