Beautiful soup安装初运行遇到的问题解决

1、 下载:

https://www.crummy.com/software/BeautifulSoup/#Download

2、文档:

https://www.crummy.com/software/BeautifulSoup/bs4/doc/

3、安装,两种方法:

1、windows下cmd进入bs根目录:C:\Python34\python.exe  setup.py install

会在python根目录C:\Python34\Lib\site-packages生成beautifulsoup4-4.4.1-py3.4.egg文件

2:拷贝:直接把解压的文件下的bs4文件夹拷贝到Lib目录底下



4、遇到的问题:

初次运行的时候,提示:

You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>'You need to convert the code, either by installing it (python setup.py install) or by running 2to3 (2to3 -w bs4).

尝试解决:

针对第一种安装方法:cmd命令行下>> python C:\Python34\Tools\Scripts\2to3.py -w bs4

针对第二种安装方法:cmd命令行下,先进入bs4的库文件夹,然后执行上面命令

猜你喜欢

转载自lhdst-163-com.iteye.com/blog/2345457