python安装 web3 报错 Microsoft visual c++ 14.0 is require “io.h”: No such file or directory

Microsoft visual c++ 14.0 is required

下载最新版的visual studio 下载器 ,我选择的是 community 版本。运行之后,进行安装,在单个组建目录下选择符合自己系统和版本要求的MSVC v14* 生成工具build tool 。

python安装 web3 报错 Microsoft visual c++ 14.0 is require “io.h”: No such file or directory_第1张图片

安装完成后,我重启了一次,不再报Microsoft visual c++ 14.0 is required 的错误。

但是出现error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.21.27702\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

参考 Github问题 https://github.com/sammchardy/python-binance/issues/148

Saledddar commented on Mar 21, 2018 • 

Refer to this link:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted

Download the right whl package for you python version(if you have trouble knowing what version of python you have, just lunch the interpreter ), in my case it was python 3.6 32 bit

use pip to install the package, assuming that the file is in downloads folder :
python -m pip install C:\Users\%USER%\Downloads\Twisted-17.9.0-cp36-cp36m-win32.whl

You can then try to install python-binance again usng pip

装了这个twisted 问题似乎推进了一些。

出现了一个 Non-zero exit code (1) 报错,

解决方法是

pip python -m pip install --upgrade pip

安装依赖包时,出现新的报错

Installing collected packages: lru-dict, cytoolz, eth-typing, pycryptodome, eth-hash, eth-utils, six, attrdict, eth-keys, rlp, hexbytes, eth-rlp, eth-keyfile, eth-account, pywin32, pypiwin32, webso
ckets, parsimonious, eth-abi, web3
  Running setup.py install for lru-dict ... error
    ERROR: Complete output from command 'c:\users\%USER%\

 c:\users\%USER%\appdata\local\programs\python\python37\include\pyconfig.h(59): fatal error C1083: 无法打开包括文件: “io.h”: No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.21.27702\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

问题还是出在VC的安装。

上网查询后找到 stackoverflow的这个回答帮助了我。还是在visual studio 下载器中要将下列所有的组件安装

install

  1. Visual C++ Build tools core features.
  2. VC++ 2017 v141 toolset (x86,x64)
  3. Visual C++ 2017 Redistributable Update
  4. Windows 10 SDK (10.0.16299.0) for Desktop C++

其中有一些可能不好找,总之,我在安装了下图这些组件之后就成功 pip install web3 了 

python安装 web3 报错 Microsoft visual c++ 14.0 is require “io.h”: No such file or directory_第2张图片

web3 安装成功!

python安装 web3 报错 Microsoft visual c++ 14.0 is require “io.h”: No such file or directory_第3张图片

你可能感兴趣的:(python安装 web3 报错 Microsoft visual c++ 14.0 is require “io.h”: No such file or directory)