Why am I installing a “C extension cannot be compiled” when installing simplejson?

btw, I use windows, so do I need 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: C extension cannot be compiled, acceleration is 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... 
+4
source share
2 answers

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

+3
source

This is because simplejson explicitly contains some C extension code to compensate for some processing, which increases speed and efficiency, but the person was kind enough to provide a clean python alternative for machines that cannot compile c python code extensions. The same thing is observed with other modules such as SQLAlchemy and hiredis

+1
source

Source: https://habr.com/ru/post/1435780/


All Articles