annoy: Windows 7 x64 And Anaconda v5.0.1 - Unable to Install annoy
Using latest (as of yesterday) Anaconda install using python 3.6.4, When I attempt to install via:
pip install annoy
I get the following error:
(Seq2Seq) C:\Users\lrichards>pip install annoy Collecting annoy Using cached annoy-1.11.1.tar.gz Building wheels for collected packages: annoy Running setup.py bdist_wheel for annoy … error Complete output from command C:\Users\lrichards\AppData\Local\Continuum\anaco da3\envs\Seq2Seq\python.exe -u -c “import setuptools, tokenize;file=‘C:\Us rs\LRICHA~1\AppData\Local\Temp\pip-build-xg1qh4j5\annoy\setup.py’;f=geta tr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.clos ();exec(compile(code, file, ‘exec’))” bdist_wheel -d C:\Users\LRICHA~1\AppD ta\Local\Temp\tmp25o7_qvdpip-wheel- --python-tag cp36: running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.6 creating build\lib.win-amd64-3.6\annoy copying annoy_init_.py -> build\lib.win-amd64-3.6\annoy running build_ext building ‘annoy.annoylib’ extension creating build\temp.win-amd64-3.6 creating build\temp.win-amd64-3.6\Release creating build\temp.win-amd64-3.6\Release\src C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe /c /nologo Ox /W3 /GL /DNDEBUG /MT -IC:\Users\lrichards\AppData\Local\Continuum\anaconda3
nvs\Seq2Seq\include -IC:\Users\lrichards\AppData\Local\Continuum\anaconda3\envs Seq2Seq\include “-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Inclu e” “-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um” /EHsc /Tps c/annoymodule.cc /Fobuild\temp.win-amd64-3.6\Release\src/annoymodule.obj annoymodule.cc c:\users\lrichards\appdata\local\temp\pip-build-xg1qh4j5\annoy\src\annoylib.h 19) : fatal error C1083: Cannot open include file: ‘stdio.h’: No such file or d rectory error: command ‘C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bi \cl.exe’ failed with exit status 2
Failed building wheel for annoy Running setup.py clean for annoy Failed to build annoy Installing collected packages: annoy Running setup.py install for annoy … error Complete output from command C:\Users\lrichards\AppData\Local\Continuum\ana onda3\envs\Seq2Seq\python.exe -u -c “import setuptools, tokenize;file=‘C:\ sers\LRICHA~1\AppData\Local\Temp\pip-build-xg1qh4j5\annoy\setup.py’;f=ge attr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.cl se();exec(compile(code, file, ‘exec’))” install --record C:\Users\LRICHA~1
ppData\Local\Temp\pip-s36zmsav-record\install-record.txt --single-version-exter ally-managed --compile: running install running build running build_py creating build creating build\lib.win-amd64-3.6 creating build\lib.win-amd64-3.6\annoy copying annoy_init_.py -> build\lib.win-amd64-3.6\annoy running build_ext building ‘annoy.annoylib’ extension creating build\temp.win-amd64-3.6 creating build\temp.win-amd64-3.6\Release creating build\temp.win-amd64-3.6\Release\src C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe /c /nolog /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\lrichards\AppData\Local\Continuum\anaconda \envs\Seq2Seq\include -IC:\Users\lrichards\AppData\Local\Continuum\anaconda3\en s\Seq2Seq\include “-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Inc ude” “-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um” /EHsc /T src/annoymodule.cc /Fobuild\temp.win-amd64-3.6\Release\src/annoymodule.obj annoymodule.cc c:\users\lrichards\appdata\local\temp\pip-build-xg1qh4j5\annoy\src\annoylib h(19) : fatal error C1083: Cannot open include file: ‘stdio.h’: No such file or directory error: command ‘C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ in\cl.exe’ failed with exit status 2----------------------------------------Command “C:\Users\lrichards\AppData\Local\Continuum\anaconda3\envs\Seq2Seq\pyth n.exe -u -c “import setuptools, tokenize;file=‘C:\Users\LRICHA~1\AppData \Local\Temp\pip-build-xg1qh4j5\annoy\setup.py’;f=getattr(tokenize, ‘open’, pen)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record C:\Users\LRICHA~1\AppData\Local\Temp\pip-s 6zmsav-record\install-record.txt --single-version-externally-managed --compile” failed with error code 1 in C:\Users\LRICHA~1\AppData\Local\Temp\pip-build-xg1q 4j5\annoy\
There is no annoy package available via Conda for Windows and no package listed in Anaconda Navigator.
How can I get this lib installed under Window?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (1 by maintainers)
Hello I found the solution for installing annoy in anaconda and windows. The solution is mainly in the https://wiki.python.org/moin/WindowsCompilers
This problem does not happen in Linux, but windows does not have C++ compilers in some cases and you should install it by yourself.
1 ) run the following command : install or upgrade the Setuptools Python package
pip install --upgrade setuptools2 ) go the following link https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019
and download the Build Tools for Visual Studio 2019
These Build Tools allow you to build Visual Studio projects from a command-line interface. Supported projects include: ASP.NET, Azure, C++ desktop, ClickOnce, containers, .NET Core, .NET Desktop, Node.js, Office and SharePoint, Python, TypeScript, Unit Tests, UWP, WCF, and Xamarin.
3 ) install Build Tools for Visual Studio 2019
during the installation, select the following items
restart your system (PC)
run the following command in Anaconda prompt
pip install --user annoyNow you can use annoy in your python code.
nice! i’ll see if there’s a way to precompile a binary package using appveyor
yeah if anyone can help me with conda, would appreciate it!
@wergeld It appears that the VS 2012 compiler is selected when you run
setup.py install(you almost certainly should be using the VS 2015 compiler for python 3.6)Not sure where setuptools selects the compiler, but I’m fairly sure your problem is there.