简体   繁体   English

如何安装SimpleJson Package for Python

[英]How to install SimpleJson Package for Python

http://pypi.python.org/pypi/simplejson http://pypi.python.org/pypi/simplejson

I am just diving into the Python world and want to make a simple twitter application which requires the installation of simplejson but not sure how I can set it up and get it working.. 我只是潜入Python世界,并希望制作一个简单的twitter应用程序,需要安装simplejson但不知道如何设置它并让它工作..

I am on a Windows System 我在Windows系统上

I would recommend EasyInstall , a package management application for Python. 我推荐EasyInstall ,一个Python的包管理应用程序。

Once you've installed EasyInstall, you should be able to go to a command window and type: 安装EasyInstall后,您应该可以转到命令窗口并键入:

easy_install simplejson

This may require putting easy_install.exe on your PATH first, I don't remember if the EasyInstall setup does this for you (something like C:\\Python25\\Scripts ). 这可能需要首先在您的PATH上放置easy_install.exe,我不记得EasyInstall设置是否为您执行此操作(类似于C:\\Python25\\Scripts )。

真正简单的方法是:

pip install simplejson

If you have Python 2.6 installed then you already have simplejson - just import json ; 如果您安装了Python 2.6,那么您已经拥有了simplejson - 只需导入json ; it's the same thing. 这是同一件事。

You can import json as simplejson like this: 您可以像这样导入json as simplejson:

import json as simplejson

and keep backward compatibility. 并保持向后兼容性。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM