编程语言
首页 > 编程语言> > python – 为什么我在安装simplejson时得到“C扩展无法编译”?

python – 为什么我在安装simplejson时得到“C扩展无法编译”?

作者:互联网

顺便说一下,我正在使用Windows,所以我必须安装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
    ***************************************************************************

警告:无法编译C扩展,未启用加速.

    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...

解决方法:

为了能够在Windows上编译Python C扩展模块,您需要安装正确版本的Visual Studio.见Building C and C++ Extensions on Windows.

标签:python,windows,visual-studio,python-extensions
来源: https://codeday.me/bug/20190625/1288364.html