1、安装beautifulsoup时出现的错误
'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`).'
解决办法:
1、切换到解压目录下
root@gao:~/beautifulsoup4-4.6.0# pwd
/root/beautifulsoup4-4.6.0
2、将bs4目录拷贝到/usr/lib目录下,通常/usr/lib是python安装的目录
root@gao:~/beautifulsoup4-4.6.0# cp bs4/ -r /usr/lib/
3、切换到/usr/lib目录下,执行如下指令:
root@gao:~/beautifulsoup4-4.6.0# 2to3 bs4 -w
问题就解决了