How to install Python module?

luckeryin發表於2009-05-13

FeedParser for Example

Introduction

Universal Feed Parser is a Python module for downloading and parsing syndicated feeds. It can handle RSS 0.90, Netscape RSS 0.91, Userland RSS 0.91, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0, RSS 2.0, Atom 0.3, Atom 1.0, and CDF feeds. It also parses several popular extension modules, including Dublin Core and Apple's iTunes extensions.

If your python hasn't the module and it will raise a expection like this "No module named feedparser" when you use "import feedparser" in code.

But how to deal with this problem?

We should install the module clearly. I download it from internet(http://code.google.com/intl/zh-CN/). The package contain two *.py files(feedparser.py & setup.py) and a folder named "docs"(html files for examples of how to use the module). Now ,we should let python to know feedparser module in code files.

In windows, I copy feedparser.py and setup.py to the directory of python installe,and then run the CMD and local to it. Use command like this:

python setup.py install

image

OK, it now works well. Just make a test.

相關文章