python安装simplejson

[ 2018-08-29 15:20:08 | 作者: admin ]
字号: | |
没有安装simplejson时报错

>>> import simplejson

Traceback (most recent call last):

    File “<stdin>”, line 1, in <module>

ImportError: No module named simplejson

simplejson是ansible一个很重要的依赖,经测试在python 2.4.3及以上版本都可以用python setup.py install 安装成功。

方法一:

yum install python-simplejson -y

方法二:

wget https://pypi.python.org/packages/source/s/simplejson/simplejson-3.5.2.tar.gz#md5=10ff73aa857b01472a51acb4848fcf8b --no-check-certificate
tar vxzf simplejson-3.5.2.tar.gz
cd simplejson-3.5.2
python setup.py install

方法三:

pip install simplejson

方法四:

easy_install simplejson
评论Feed 评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=2531

这篇日志没有评论。

此日志不可发表评论。