Windows下使用BeautifulSoup 出现You are trying to run the Python 2 version of Beautiful Soup under Python

来源:互联网 发布:用户画像建模算法 编辑:程序博客网 时间:2024/06/06 02:19

Windows下使用BeautifulSoup 出现You are trying to run the Python 2 version of Beautiful Soup under Python

解决方法: 需要将bs4通过python自带的工具2to3.py转化为python3下的文件,这个工具在python安装目录的Tools\scripts中。

去BeautifulSoup安装目录或者解压目录下,拷贝bs4的库文件夹到python安装目录的Lib中,然后cmd进入这个Lib文件夹,输入python 2to3.py文件路径 -w bs4

导入其他库出现这种情况应该也可以这样解决。

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