linux下安装BeautifulSoup模块
来源:互联网 发布:淘宝网大童女鞋 编辑:程序博客网 时间:2024/05/22 01:33
linux下安装BeautifulSoup模块
(2013-08-20 10:56:51)BeautifulSoup4安装
BeautifulSoup4需要python3,若是使用2.7,会出现html.entities报错。
1)python 升级
转载:http://www.cnblogs.com/lanxuezaipiao/archive/2012/10/21/2732864.html
首先下载源tar包
可利用linux自带下载工具wget下载,如下所示:
1
# wget http://www.python.org/ftp
/python/3.3.2/Python-3.3.2
.tgz
这里我用的是第二种方法,下载的是Python-3.3.2.tar.bz2版本,下载完成后到下载目录下,解压
1
bunzip2
Python-3.3.2.tar.bz2
2
tar -xvf Python-3.3.2.tar
(若是第一种方法,则直接解压缩tar -xzvf Python-3.3.2.tgz)
进入解压缩后的文件夹
1
cd
Python-3.3.2
在编译前先在/usr/local建一个文件夹python3(作为python的安装路径,以免覆盖老的版本)
1
mkdir
/usr/
local
/python3
开始编译安装
1
./configure --prefix=/usr/
local
/python3
2
make
3
make
install
此时没有覆盖老版本,再将原来/usr/bin/python链接改为别的名字(这步可以不做,同时保留多个python版本)
1
mv
/usr/bin/python /usr/bin/python_old
再建立新版本python的链接
1
ln
-s /usr/
local
/python3/bin/python3 /usr/bin/python
这个时候输入
1
python
就会显示出python的新版本信息
1
Python 3.1.2 (r312:79147, Oct 21 2012, 01:03:21))
2
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
3
Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more
information.
4
>>>
PS:如果不建立新安装路径python3,而是直接默认安装,则安装后的新python应该会覆盖linux下自带的老版本,也有可能不覆盖,具体看安装过程了,这个大家可以自己试验下,当然如果还想保留原来的版本,那么这种方法最好不过了。
2)安装 python中的BeautifulSoup模块
from bs4 import BeautifulSoup
- linux下安装BeautifulSoup模块
- 安装BeautifulSoup模块
- Python-Windows下安装BeautifulSoup和requests第三方模块
- python BeautifulSoup模块的安装
- pyhon BeautifulSoup模块的安装
- python BeautifulSoup模块的安装
- python BeautifulSoup模块的安装
- windows下安装BeautifulSoup
- Windows下安装BeautifulSoup
- windows 下安装BeautifulSoup
- windows 7 下安装BeautifulSoup
- python中BeautifulSoup模块的安装
- Python中 BeautifulSoup模块的安装
- Python安装第三方模块BeautifulSoup
- PyCharm安装第三方模块Request、BeautifulSoup
- PyCharm安装第三方模块Request、BeautifulSoup
- BeautifulSoup win+linux 安装配置
- BeautifulSoup模块
- apache安全设置——某个目录只允许访问图片,其他类型文件不允许访问
- AndroiddrawCircle方法:绘制圆形
- 摩托罗拉defy刷死机了,救治的方法 刷底包的方法和教程
- Java多线程及线程状态转换
- hdu 1222 Wolf and Rabbit
- linux下安装BeautifulSoup模块
- 聚集索引和非聚集索引
- 新的阵地
- HBase--完全分布式搭建
- @RequestMapping 用法详解之地址映射
- EL表达式-自定义函数
- 硬盘的启动模式
- postgreSQL dropdb 时 还有会话没有关闭
- Search for a Hiding-Place (URAL 1762)