You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.
2017-09-19 09:06
1336 查看
在python3下直接使用安装的BeautifulSoup包会提示下面这段错误:
解决方案之一:
将beautifulsoup文件夹下的bs4转换成python3的版本即可,
使用python3安装目录下lib文件夹中的2to3命令
如果将python3添加到了环境变量中则可以直接使用命令,如果没有则需要定位到python3安装目录下的lib目录
2to3
/beautifulsoup/bs4(beautifulsoup安装目录下的bs4) -w
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`)
解决方案之一:
将beautifulsoup文件夹下的bs4转换成python3的版本即可,
使用python3安装目录下lib文件夹中的2to3命令
如果将python3添加到了环境变量中则可以直接使用命令,如果没有则需要定位到python3安装目录下的lib目录
2to3
/beautifulsoup/bs4(beautifulsoup安装目录下的bs4) -w
相关文章推荐
- 'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>
- 错误 You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work
- Windows下Python3安装BeautifulSoup4显示'You are trying to run the Python 2 version of Beautiful Soup under
- Windows下使用BeautifulSoup 出现You are trying to run the Python 2 version of Beautiful Soup under Python
- Windows环境下安装beautifulsoup4出现 'You are trying to run the Python 2 version of Beautiful Soup ....错误
- This Style does not belong to the supplied Workbook. Are you trying to assign a style from one workb
- This version of Visual Studio .NET does not support source controlled projects. Any changes that you make to this project will n
- "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."
- Failure to find xxx in xxx was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced @ xxx
- 安装mysql时,报“unable to find a version of the runtime to run this application ”
- 黄聪:.Net Framework Initialization Error – Unable to find a version of the runtime to run this application解决方案
- .NET版本问题 转[.Net Framework Initialization Error – Unable to find a version of the runtime to run this applicatio]
- docker 解决:Get http:///var/run/docker.sock/v1.19/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
- Unable to find a version of the runtime to run this application.【matlab】
- unable to find a version of the runtime to run this application.
- Unable to find a version of the runtime to run this application解决方法
- 装mysql时,报unable to find a version of the runtime to run this application
- 解决错误:unable to find a version of the runtime to run this application
- Maven-010-maven 编译报错:Failure to ... in ... was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced.
- 解决 this virtual machine’s policies are too old to be run by this version of vmware workstation”