Background:
I am new to python/Cpp and I am trying to install a python package python-crfsuite which needs to VS to compile.
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
)I have already run
vcvarsall.bat
All commands I run are in admin
Process:
When I trying to pip install
python-crfsuite, it gives me the error:
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.Then I try to download
io.h
and place inC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include
but it is useless.Finally I try to use conda install
conda install -c conda-forge python-crfsuite
and it is success
Question
Why
conda install
dose not have the problem withio.h
, any difference withpip 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 differentcl.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