4

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...
6502
  • 112,025
  • 15
  • 165
  • 265
hugemeow
  • 7,777
  • 13
  • 50
  • 63

2 Answers2

3

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.

Piotr Dobrogost
  • 41,292
  • 40
  • 236
  • 366
  • 2
    @hugemeow Grab already compiled package from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and install it using `easy_install` after reading my answer to http://stackoverflow.com/questions/3271590/ question. – Piotr Dobrogost Sep 24 '12 at 20:54
  • i need pysqlite-2.7.3 which is not provided by http://www.lfd.uci.edu/~gohlke/pythonlibs/#pysqlite – hugemeow Sep 24 '12 at 21:06
  • 2
    There's no 2.7.3 version of pysqlite; 2.6.3 is the newest and Windows' binary is available both at http://code.google.com/p/pysqlite/downloads/list and at http://lfd.uci.edu/~gohlke/pythonlibs – Piotr Dobrogost Sep 24 '12 at 21:12
  • do you know how to build sqlite support for python on linux? – hugemeow Sep 24 '12 at 21:16
  • If you already have sqlite installed (including headers) then `pip install pysqlite` should do the job. – Piotr Dobrogost Sep 24 '12 at 21:21
  • i have sqlite installed, but that don't means i have python's sqlite extension, maybe that is just kind of sqlite.a in lib dir, without this lib, pip install pysqlite will fail.. – hugemeow Sep 24 '12 at 21:26
1

This is because simplejson obviously contains some C extension code to offset some of the processing this increases speed and efficiency, but the person was kind enough to provide a pure python alternative for machines that cannot compile c extensions of python code. The same is seen with other modules like SQLAlchemy and hiredis

Jakob Bowyer
  • 33,878
  • 8
  • 76
  • 91