I have been trying to install Cython for Python 2.7 on my Window 7 system. In particular, I prefer everything in 64 bits. (In case you wonder, I need Cython because Cython i
I encountered this problem while trying to install pandas
in 'develop' mode. I'm up & running now. My environment:
<--
"registered" as system's python distro using WinPython Control Panel applicationProblems encountered when running python setup.py develop
:
Solution:
<--
this gives you basetsd.h
<--
this gives you the 64-bit compilersC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat
to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
. Observe the change in file name.C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
to PATH
. This may not be required (I did so before re-installing the SDK w/ Headers & Libs; therefore, the necessity is unknown).At this point, running python setup.py develop
completed successfully and python -c "import pandas; print pandas.__version__"
resulted in the git tag I expected.
[EDIT] Further reading:
For those with Windows 10, download the SDK from here to fix the header file basestd.h
.
I downloaded the .exe, installed and worked great. SDK was ~2.3GB.
Note: For those like me with 64-bit systems who got an additional error:
`LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
There is a great answer here which solves the problem by placing the rc.exe
file in the correct folder for your system.
In case anyone is currently (2017) facing same error with visual C++ 2015 tools, launch setup again and also select windows 8.1 / 10 SDK depending upon your OS. This will fix basestd.h
error.
If it is still not working, try launching build tools from: C:\Program Files (x86)\Microsoft Visual C++ Build Tools.
Another alternative would be, just install anaconda 2 or 3 (64 bit if also you don't want memory errors). It contains all the important packages prebuilt: sklearn, matplotlib, scipy, numpy, pandas and even web development frameworks such as flask.
Add these to the visual studio installation directories to your Environment variables
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools
hope it solves the issue.
For suggestion, you can try it for build cython 64 bit with setup.py
I'm using Anaconda for python distribution, Microsoft's Windopws SDK 7, and MSVC 12.0.
Firstly, I make library for my cuda function, Second, I run python setup.py build_ext -i for make temp folder (you wil get error), then compile Makefile below,
Mostly, I get this from setup.py when it is compile 32 bit app, then change it for compile 64 bit.
Makefile
CL_EXE = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe"
LINK_EXE = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\link.exe"
CL_FLAGS = /c /nologo /Ox /MD /W3 /GS- /DNDEBUG /O2 /fp:fast
CL_INC = -I. -I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Include" \
-I"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include" -IC:\Users\name\Anaconda2\envs\py27\Lib\site-packages\numpy\core\include -IC:\Users\name\Anaconda2\envs\py27\include -IC:\Users\name\Anaconda2\envs\py27\PC
LINK_FLAGS = /DLL /nologo /INCREMENTAL:NO /MACHINE:X64
LINK_LIBPATH = "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\x64" \
/LIBPATH:C:\Users\name\Anaconda2\envs\py27\libs \
/LIBPATH:C:\Users\name\Anaconda2\envs\py27\PCbuild\amd64 \
/LIBPATH:C:\Users\name\Anaconda2\envs\py27\PC\VS9.0\amd64 \
"/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64" \
"/LIBPATH:C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64"
LINK_LIB = cuda_multiply4D.lib cudart.lib MSVCRT.lib kernel32.lib
LINK_EXPORT = /EXPORT:initmy_cuda
LINK_OBJ = build\temp.win-amd64-2.7\Release\my_cuda.obj
LINK_OUT = "/OUT:E:\my_cuda.pyd"
LINK_OTHER_CONF = /IMPLIB:build\temp.win-amd64-2.7\Release\my_cuda.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\my_cuda.pyd.manifest
all:
$(CL_EXE) $(CL_FLAGS) $(CL_INC) /Tcmy_cuda.c /Fobuild\temp.win-amd64-2.7\Release\my_cuda.obj
$(LINK_EXE) $(LINK_FLAGS) $(LINK_LIBPATH) $(LINK_LIB) $(LINK_EXPORT) $(LINK_OBJ) $(LINK_OUT) $(LINK_OTHER_CONF)
Note: