简体   繁体   English

pyconfig.h - 无法打开包含文件:'io.h':没有这样的文件或目录

[英]pyconfig.h - Cannot open include file: 'io.h': No such file or directory

Background: 背景:

  • I am new to python/Cpp and I am trying to install a python package python-crfsuite which needs to VS to compile. 我是python / Cpp的新手,我正在尝试安装一个需要VS编译的python包python-crfsuite。

  • I have installed Anaconda3, pyhon3.6 all in VS2017 community installer (because I think it is better because I will use compiler of VS: cl.exe ) 我在VS2017社区安装程序中安装了Anaconda3,pyhon3.6(因为我认为它更好,因为我将使用VS的编译器: cl.exe

  • I have already run vcvarsall.bat 我已经运行了vcvarsall.bat

  • All commands I run are in admin 我运行的所有命令都在admin中

Process: 处理:

When I trying to pip install python-crfsuite, it gives me the error: 当我试图pip install python-crfsuite时,它给了我错误:

C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.10.25017\\bin\\HostX86\\x86\\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -Icrfsuite/win32 -Iinclude "-IC:\\Program Files\\Anaconda3\\include" "-IC:\\Program Files\\Anaconda3\\include" /EHsc /Tppycrfsuite/_pycrfsuite.cpp /Fobuild\\temp.win-amd64-3.6\\Release\\pycrfsuite/_pycrfsuite.obj _pycrfsuite.cpp c:\\program files\\anaconda3\\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\\\\Community\\\\VC\\\\Tools\\\\MSVC\\\\14.10.25017\\\\bin\\\\HostX86\\\\x86\\\\cl.exe' failed with exit status 2

  • I have read the answer from here . 我从这里读到了答案。 So I try to replace the path in my system environment as following: C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.10.25017\\bin\\HostX86\\x86 => C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.10.25017\\bin\\HostX86\\x86 but it doesnt do anything for me. 所以我尝试在系统环境中替换路径如下: C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.10.25017\\bin\\HostX86\\x86 => C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.10.25017\\bin\\HostX86\\x86但它对我没有任何作用。

  • Then I try to download io.h and place in C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.10.25017\\include but it is useless. 然后我尝试下载io.h并放在C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.10.25017\\include但它没用。

  • Finally I try to use conda install conda install -c conda-forge python-crfsuite and it is success 最后我尝试使用conda install conda install -c conda-forge python-crfsuite并且它是成功的

Question

  • Why conda install dose not have the problem with io.h , any difference with pip install ? 为什么conda install剂量没有io.h的问题,与pip install什么区别?

  • Why there are multiple cl.exe in different path in VS (I am not so familiar with) and are there any difference in using different cl.exe ? 为什么VS中的不同路径中有多个cl.exe (我不太熟悉),使用不同的cl.exe有什么区别?

I ask these question because even if I installed Anaconda, if I want to use pip install, I have to face these problems and I still cannot figure it out 我问这些问题,因为即使我安装了Anaconda,如果我想使用pip install,我也要面对这些问题,我仍然无法弄明白

I got the same error but I was installing a package. 我得到了同样的错误,但我正在安装一个包。 I solved installing more tools from Visual Studio (I'm using VS 2017 Community and Python 3.6.4). 我解决了从Visual Studio安装更多工具的问题(我正在使用VS 2017社区和Python 3.6.4)。 I installed those tools (see installer screenshot here ): 我安装了这些工具(参见此处的安装程序截图):

  1. Desktop development with C++: I included all defaulted items and the next ones: 使用C ++进行桌面开发:我包含了所有默认项目和下一个项目:

    • Windows XP support for C++ Windows XP对C ++的支持
    • Support for C++/CLI 支持C ++ / CLI
    • VC++ 2015.3 v140 toolset VC ++ 2015.3 v140工具集
  2. Linux development with C++ 使用C ++进行Linux开发

Then I opened the Windows PowerShell as Administrator privilegies (Right click to open) and move folder of Visual Studio installation and find that path: 然后我以管理员权限打开Windows PowerShell (右键单击打开)并移动Visual Studio安装文件夹并找到该路径:

cd [Visual Studio Path]\VC\Auxiliary\Build

Then I executed this file: 然后我执行了这个文件:

.\vcvars32.bat

After that I use pip as normal, for instance, I wanted to install Mayavi : 之后我正常使用pip,例如,我想安装Mayavi

pip install mayavi

I hope that it helps someone too. 我希望它也有助于某人。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法打开包含文件:“io.h”:没有这样的文件或目录 - Cannot open include file: 'io.h': No such file or directory 致命错误:pyconfig.h:没有这样的文件或目录 - Fatal error: pyconfig.h: No such file or directory 无法打开包含文件:&#39;io.h&#39;:没有这样的文件或目录,Python 3.7.5,Windows 8.1,VS v 2019 - Cannot open include file: 'io.h': No such file or directory, Python 3.7.5, Windows 8.1, VS v 2019 致命错误 C1083:无法打开包含文件:'io.h':没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'io.h': No such file or directory 使用“ #include”导入时,Boost Python“无法打开源文件&#39;pyconfig.h&#39;” <boost\\python.hpp> ” - Boost Python “cannot open source file 'pyconfig.h'” when importing using “#include <boost\python.hpp>” 在cpp proj中没有这样的文件pyconfig.h - No such file pyconfig.h in cpp proj Could not install pycocotools in windows: fatal error C1083: Cannot open include file: 'io.h': No such file or directory 错误: - Could not install pycocotools in windows: fatal error C1083: Cannot open include file: 'io.h': No such file or directory error: 无法构建 boost python 库(致命错误:pyconfig.h: No such file or directory) - Cannot build boost python library (fatal error: pyconfig.h: No such file or directory) 编译Cython代码产生...致命错误C1083:无法打开包含文件:&#39;io.h&#39; - Compiling Cython code yields… fatal error C1083: Cannot open include file: 'io.h' /usr/include/boost/python/detail/wrap_python.hpp:50:23:致命错误:pyconfig.h:没有这样的文件或目录 - /usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM