error: Python was built with Visual Studio 2003

在windows上安装rdflib2.4.0的时候出现如下错误:

Python was built with Visual Studio 200*” error:
Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system.
If you have Cygwin installed, you can try compiling with MingW32, by passing “-c mingw32″ to setup.py.

在google之后,找到网上的解决方法,如下:

Python for Windows is built using Visual Studio 2003; however the Bison-generated parser does not seem to generate C code that is compatible with this compiler. Therefore, it is recommended that gcc be installed, either through cygwin or by downloading MinGW. More details can be found on this page , but we will also summarize it here, assuming we take the cygwin route.

1. Install Python 2.5 , Windows Installer download is fine.

2. Download and run cygwin setup , making sure to include to following packages (No need to install the version of Python that comes with cygwin):

  • gcc-mingw
  • gcc-mingw-core
  • gcc-mingw-g++
  • make

3. Add [cygwin dir]/bin to PATH.

4. In order to ensure that gcc is used for building extensions, create a file [Python 2.5 dir]/lib/distutils/distutils.cfg :

  


[build]
compiler = mingw32

 

5. Download RDFLib release version or source .

6. Run rdflib/setup.py install.

你可能感兴趣的:(error: Python was built with Visual Studio 2003)