在看《集体智慧编程》时碰到python3环境下安装feedparser的问题,搜索发现很多人碰到此问题,最终找以下方法解决。

how to install feedparser on python3

Approach A: Using Pip

The
best method for installing FeedParser (or almost any Python package) is
by using pip, Python's package manager. pip will be installed by
default alongside Python as of Python 3.4 (and Python 2.7.9). Since the
latest version of Python (as of time of editing) is Python 3.5, this is
really the approach you should be taking whenever possible.

To run pip, do the following:

Open the command line. You can do this by clicking start, then typing cmd in the run textbox.
    Make sure you are connected to the internet.
    Type in pip install feedparser and hit enter (and wait for pip to download and install FeedParser)

You're done! Open up IDLE and type in import feedparser to confirm.

If attempting to use pip fails for some reason, try...

Typing in C:\Python34\Scripts\pip install feedparser (or wherever you installed Python)
   
Closing the command line, and re-opening it in admin mode (click start,
type 'cmd', right-click, select "Run as Administrator"), if it's
failing due to permission errors

If
you would like to learn more about pip, or need help setting it up on
older versions of Python, see this
post(http://stackoverflow.com/questions/15724093/difference-between-python-setup-py-install-and-pip-install/15731459#15731459).

Approach B: Manual install

If, for some reason, you are unable to use pip, you can always try doing a manual install.
Part A: Prerequisites:

Feedburner
needs a module named setuptools in order to install. Unfortunately,
setuptools isn't compatible with Python 3.x, but you can use something
called Distribute as a convenient replacement. If you already have this
installed, you can skip Part A.

Download the "installer" here:
http://python-distribute.org/distribute_setup.py. This is a Python
script that will download the required components from the internet and
install Distribute for you.

Open the command line. You can do this by clicking start, then typing
cmd in the run textbox. Navigate over to the folder containing
distribute_setup.py by using cd. On my system, I typed cd
C:\Users\Michael0x2a\Downloads

Type python distribute_setup.py (and if that doesn't work,
C:\Python32\python.exe distribute_setup.py (or wherever you did install
Python)). A bunch of text should appear and scroll by.

Part B: Actually installing feedparser:

Download and extract the latest file from here: https://github.com/kurtmckee/feedparser/releases

Navigate in the command line to where the extracted feedparser folder
is by using the cd command. For example, on my computer, I typed:

cd C:\Users\Michael0x2a\Downloads\feedparser-5.1\feedparser-5.1

(Your version number will probably differ. For example, you might have feedparser-5.3 or something)

Make sure the folder you're in has the readme, various other docs, and
setup.py. To check, type dir into the command line. It should list the
files and folders there.

Type python setup.py install (or C:\Python34\python.exe setup.py install.). Text should appear and slowly scroll by.

You're done! Open up IDLE and type import feedparser to confirm.

最新文章

  1. gulp同步执行任务
  2. C++学习笔记 封装 继承 多态 重写 重载 重定义
  3. web app性能大讨论
  4. 不起眼的 z-index 却能牵扯出这么大的学问
  5. 请求一个action,将图片的二进制字节字符串在视图页面以图片形式输出
  6. C++ 排序函数 sort(),qsort()的含义与用法 ,字符串string 的逆序排序等
  7. Android 实现Path2.0中绚丽的的旋转菜单
  8. ios的UIImage的两种不同的图片加载方式 tom猫
  9. 网口扫盲三:以太网芯片MAC和PHY的关系
  10. cocos2d-x实战 C++卷 学习笔记--第4章 使用标签
  11. [转] c#多线程(UI线程,控件显示更新) Invoke和BeginInvoke 区别
  12. Webx框架:Valve详细解释
  13. Linux监控体系
  14. 多行文本省略号的实现.html
  15. 【vim】插件管理及代码智能提示与补全环境的配置
  16. LeetCode之旅(17)-Ugly Number
  17. android studio 在使用图片的时候会检测图片的合法性
  18. sql中检查时间是否重叠
  19. hdu 3480 Division(四边形不等式优化)
  20. mysql 字符集

热门文章

  1. 讲解JSP自定义标签
  2. AbstractIdleService
  3. java md5 函数
  4. shell中字体变色
  5. You-Get 一键下载全网视频资源
  6. Linux下GCC和Makefile实例(从GCC的编译到Makefile的引入)
  7. php excel 设置单元格格式为文本格式
  8. 蓝桥杯 算法训练 ALGO-60 矩阵乘法
  9. 【转】JMeter工作基本原理
  10. php图像处理函数imagecopyresampled