2

I'm trying to follow this tutorial: https://pytools.codeplex.com/wikipage?title=PollsDjangoSql but while doing "Configure the project", step 8, I am supposed to install pyodbc using easy_install, but all that happens is:

Installing 'pyodbc'
'pyodbc' failed to install. Exit code: 1

So I have no idea what is the problem, and as it is extremely generic it is hard to google it. I am using Visual Studio 2013, Python 2.7, Windows 8.1 64bit. Anybody has any idea what is wrong?

gumol
  • 117
  • 1
  • 12

1 Answers1

0

I spent some time last week trying to install PyODBC for Python 3.4 on a Windows 8.1 machine, and we ended up just using a pre-built wheel (.whl) file.

http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc

You can install wheel files using pip, so just enter in the location of the .whl file (or the url to the binary) and pip will install it for you. This skips any requirements of having the Visual C++ compiler set up and allows you to stick with just using pip.


I am supposed to install pyodbc using easy_install, but all that happens is: ...

You are getting an exit code of 1 because easy_install is failing to build the package. Unfortunately there isn't an easy way to get the output without manually opening up the command line and running the command yourself. There could be a number of reasons for getting an error code back, such as the wrong package name or a compilation error (most likely) when building non-Python files.

The (sometimes difficult) solution is to fix the vcversal.bat issue for your system (because that's triggering the compilation issue, usually) and try again. I wasn't able to get it working correctly alongside of Visual Studio, so you may have better luck just trying through the command line.

The other (sometimes easier) solution if you have a non-Windows system (or a virtual environment) is to build the wheels yourself. As long as you can generate the wheels to work for any system (they end with -any), they should install smoothly under Windows.

Community
  • 1
  • 1
Kevin Brown-Silva
  • 40,873
  • 40
  • 203
  • 237