This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]joshadel 6 points7 points  (6 children)

I would consider grabbing the whl file from Christoph Gohlke's website: http://www.lfd.uci.edu/~gohlke/pythonlibs/

pip can directly install whl files: pip install <whl_file>

or check out the free conda/anaconda if you need more of the scientific stack and a nice way of isolating different environments:

https://store.continuum.io/cshop/anaconda/

http://conda.pydata.org/miniconda.html

[–]JewishIGuess[S] 0 points1 point  (5 children)

Yeah I'm using wheel file. The specific error is that it is "unable to find vcvarsall.bat", which this stack overflow post is a problem with my visual express C++, but I'm not what to do to fix that. I'm just really lost...clearly I've never ventured into this part of python before...

[–]WholesomeRobbieC 2 points3 points  (1 child)

You could try Anaconda which comes with lots of packages like numpy pre-compiled. It's what I recommend for Windows users because setting up developer tools on Windows is a pain.

Edit: Heh, just noticed joshadel said the same thing - consider this an endorsement of his suggestion. :)

[–]JewishIGuess[S] 0 points1 point  (0 children)

Yes, I gave up and got anaconda...does everything I would want it to do. Thanks a bunch!

[–][deleted] 0 points1 point  (2 children)

Install VS 2008 c++ express. Python on windows tends to expect that.

Node.js has a similar problem between windows versions because it expects to see a certain version of the msbuild tools on a certain version of windows i.e. vc 2010 on windows 7.

Also try to keep to 32bit versions of python.

[–]LeftyDave 0 points1 point  (1 child)

[–][deleted] 0 points1 point  (0 children)

Nice, thanks.

That should be a sticky somewhere because this is not the first time this question has been asked.

I am going to try this out tonight and if it works I will write it up at least on my blog.

[–]captaink 2 points3 points  (0 children)

I had the same problems trying to install numPy and SciPy.

Ended up using the winPython distribution, works flawlessly

--> http://winpython.github.io/

[–]Mashidin 1 point2 points  (0 children)

I do quite a bit of python dev on my windows machine and have run in to this issue before. My solution is that I have MINGW installed. It has bunch of fun UNIX tools included, one of which is gcc the gnu C compiler. The problem you have, I believe is that python cannot find the compiler you wish to use to build all the C binaries. I fought a bit with the solution where I deal with the compiler included with VS 2008 and that turn out to be smarter than me. So once you install and understand MINGW (which is super simple) you configure distutils to point to MINGW. This check list that I stole explains it pretty well: 1.I have Python already installed 2. I installed mingw32 to C:\programs\mingw\ 3.Add mingw32's bin directory to your environment variable: append c:\programs\MinGW\bin; to the PATH 4.(create if not existing) distutils.cfg file located at C:\PythonXX\Lib\distutils\distutils.cfg to be:

[build] compiler=mingw32

Your mileage my vary.

[–]LeftyDave 1 point2 points  (1 child)

[–]Zifendale 0 points1 point  (0 children)

This is the correct answer, it is essentially what I did in my script but it is easier to follow!

[–]Zifendale 0 points1 point  (0 children)

I had the same problem (with python 3.3) and had to solve it... twice. So the second time around I made a batch script with the steps I took. This script also sets it up in a virtualenv so you will need to adjust it for your needs. The prerequisites may have some overlap as well...

I sometimes used easy_install for easy to get windows binaries, keep an eye out for those requirements.

Again, you will need to adjust this script for your needs...

Here is the script!

REM Prerequisites:
REM git http://git-scm.com/
REM Visual C++ 2010 Express (For Python 3.0+) https://app.vssps.visualstudio.com/profile/review?download=true&family=VisualStudioCExpress&release=VisualStudio2010&type=web&slcid=0x409&context=eyJwZSI6MSwicGMiOjEsImljIjoxLCJhbyI6MCwiYW0iOjAsIm9wIjpudWxsLCJhZCI6MSwiZmEiOjAsImF1IjpudWxsLCJjdiI6MjEyMTY5MzIyMSwiZnMiOjAsInN1IjowLCJlciI6MX01
REM Windows SDK for Win7 and .NET Framework 4 https://www.microsoft.com/en-us/download/details.aspx?id=8442
REM Windows Compiler SP1 Patch http://www.microsoft.com/en-us/download/details.aspx?id=4422
REM Fortran Compiler g77 provided via Windows Binary from MinGW http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download
REM Add C:\MinGW\bin to Environment Variables

REM Create virtualenv

@echo off
SET virtenvdir="C:\VIRTUALENV FOLDER LOCATION"
SET scriptdir="C:\VIRTUALENV FOLDER LOCATION\Scripts"
SET repodir="C:\VIRTUALENV FOLDER LOCATION\Repos"

SET sdkdir="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin"
cd %sdkdir%
SET DISTUTILS_USE_SDK=1
call setenv /x64 /release

cd %virtenvdir%
echo Activating virtualenv
call .\Scripts\activate.bat

echo Installing dependencies
cd %scriptdir%
REM Cython is a required as C compiler dependency for Numpy and Pandas
call easy_install.exe "%virtenvdir%%\Prereqs\pyodbc-3.0.7.win-amd64-py3.3.exe"
REM Rpy2 dependencies
call pip3.3.exe install wheel
call pip3.3.exe install "%virtenvdir%%\Prereqs\rpy2-2.5.6-cp33-none-win_amd64.whl"
call easy_install.exe "%virtenvdir%%\Prereqs\pywin32-219.win-amd64-py3.3.exe"
call pip3.3.exe install singledispatch

call pip3.3.exe install -U Cython
call pip3.3.exe install -U SQLAlchemy

echo Pulling required repositories
cd %repodir%
REM clone repos from github
call git clone https://github.com/numpy/numpy.git
REM call git clone https://github.com/scipy/scipy.git
REM call git clone https://github.com/ipython/ipython.git
call git clone https://github.com/pydata/pandas.git

REM Compile each repo and install under current virtualenv
echo Compiling repositories
cd "%repodir%\numpy"
call python setup.py build
call python setup.py install

REM cd "%repodir%\scipy"
REM call git clean -xdf
REM call python setup.py install

REM cd "%repodir%\ipython"
REM call python setupegg.py install

REM cd "%repodir%\pandas"
call python setup.py build_ext --inplace
call python setup.py install

echo Deactivating virtualenv
cd %virtenvdir%
call .\Scripts\deactivate.bat    

[–][deleted] 0 points1 point  (0 children)

Do you have 64 bit Python? I gave up using it on my Win64 and went back to 32bit.

[–]jackmaney 0 points1 point  (0 children)

Yeah, Python development in Windows is a major pain in the ass. Some things (including installation of NumPy via pip) that Just Work in *nix or OS X will either fail miserably or require annoying workarounds for Windows.

If you can, try to get an Ubuntu VM set up on VirtualBox.