您的位置:首页 > 编程语言 > Python开发

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

2017-11-26 23:31 811 查看
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




问题就解决了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐