Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为Python安装SimpleJson包_Python_Simplejson - Fatal编程技术网

如何为Python安装SimpleJson包

如何为Python安装SimpleJson包,python,simplejson,Python,Simplejson,我正潜入Python世界,想制作一个简单的twitter应用程序,它需要安装simplejson,但不确定如何设置并使其工作 我使用的是Windows系统,我推荐使用Python的包管理应用程序 安装EasyInstall后,您应该能够转到命令窗口并键入: easy_install simplejson 这可能需要首先将easy_install.exe放在您的路径上,我不记得EasyInstall安装程序是否为您这样做(类似于C:\Python25\Scripts)。如果您安装了Python

我正潜入Python世界,想制作一个简单的twitter应用程序,它需要安装simplejson,但不确定如何设置并使其工作

我使用的是Windows系统

,我推荐使用Python的包管理应用程序

安装EasyInstall后,您应该能够转到命令窗口并键入:

easy_install simplejson

这可能需要首先将easy_install.exe放在您的路径上,我不记得EasyInstall安装程序是否为您这样做(类似于
C:\Python25\Scripts
)。

如果您安装了Python 2.6,那么您已经安装了simplejson-只需导入
json
;这是一样的。

下载源代码,将其解压缩到和目录,然后执行python setup.py安装

您可以将json作为simplejson导入,如下所示:

import json as simplejson
并保持向后兼容性。

真正简单的方法是:

pip install simplejson

似乎只适用于python 2.5?我已经安装了2.6…解决方法?看起来它包含在Python 2.6中。但是,我们中的许多人仍然必须使用Python 2.5.:-)我遵循了easy_install simplejson的说明,但仍然没有成功。(我还试图安装python twitter客户端。)因此,我打开了引用simplejson的.py文件,将其更改为json,然后就成功了。:-)假设上面的评论来自“迟来的答案”或“第一篇文章”的评论队列,没有意识到这是一个答案,不是一个问题…
sudo apt get install python pip
在Ubuntu上,如果你还没有Linux版的,请下载,
tar-xvzf simplejson-3.XX.X.tar.gz