'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>

来源:互联网 发布:网络销售入门 编辑:程序博客网 时间:2024/06/06 00:02

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


问题就解决了

阅读全文
0 0
原创粉丝点击