Why I get "C extension could not be compiled" when installing simplejson?

hugemeow picture hugemeow · Sep 23, 2012 · Viewed 7.5k times · Source

btw, i am using windows, so do i have to install visual studio?

(py) D:\python>pip install simplejson
Downloading/unpacking simplejson
  Downloading simplejson-2.6.2.tar.gz (53kB): 53kB downloaded
  Running setup.py egg_info for package simplejson

Installing collected packages: simplejson
  Running setup.py install for simplejson
    building 'simplejson._speedups' extension
    ***************************************************************************

WARNING: The C extension could not be compiled, speedups are not enabled.

    Failure information, if any, is above.
    I'm retrying the build without the C extension now.



    ***************************************************************************

    ***************************************************************************
    WARNING: The C extension could not be compiled, speedups are not enabled.
    Plain-Python installation succeeded.
    ***************************************************************************
Successfully installed simplejson
Cleaning up...

Answer

Piotr Dobrogost picture Piotr Dobrogost · Sep 23, 2012

To be able to compile Python C extension modules on Windows you need the right version of Visual Studio installed. See Building C and C++ Extensions on Windows.