beautifulsoup4安装(国内源)

1.进入http://mirrors.aliyun.com/pypi/simple/beautifulsoup4/ ,寻找所需的beautifulsoup4包(注意:某些bs4包与python会有版本兼容问题,最好先自行查询。本人用的python3.6+bs4-4.6)

2.下载.tar.gz文件,解压至python总目录

3.进入beautifulsoup4-4.6.0文件夹,将其中的bs4文件夹复制到python的lib目录下

4.进入python安装目录的\Tools\scripts,将里面的2to3.py复制到python的lib目录下

5.打开CMD,进入到beautifulsoup4-4.6.0的目录

6.运行 python setup.py build  

7.运行python setup.py install  (此时会报错,没有关系)

8.cd到python安装目录的lib目录下,运行 python 2to3.py bs4 -w

9.输入python,进入python命令窗口,运行from bs4 import BeautifulSoup,若无报错,安装成功。

猜你喜欢

转载自www.cnblogs.com/jujuno/p/11071502.html
今日推荐