Windows环境下安装beautifulsoup4出现 'You are trying to run the Python 2 version of Beautiful Soup ....错误
2017-07-08 23:40
561 查看
出现这个问题的主要原因是Python的版本问题。官网上面有说明:Beautiful Soup 4 works on both Python 2 (2.6+) and Python 3.
所以在3.4+的版本上安装beautifulsoup4时会出现如下错误:
解决办法是:
使用在线安装的步骤如下:
(1)进入Python的安装目录,找到Scripts文件夹,然后进入里面,可以看到如下可执行文件(我使用的Python3.6.x):
(2)如果之前安装过,切安装失败,则首先执行以下命令卸载beautifulsoup4:
pip install beautifulsoup4
(3)使用pip3.6.exe安装beautifulsoup4,记住一定不要使用pip.exe进行安装,不然还会出现版本不同的问题。(当然如果你使用的是2.x的版本,那么你可以使用pip.exe进行安装)
安装命令:pip3.6 install beautifulsoup4
(4)如果出现如下结果则表示安装成功:
到这里在线安装beautifulsoup4基本结束。
可以在Python环境下使用from bs4 import BeautifulSoup验证是否成功安装,如果没有错误出现,那么就表示已经安装成功了。
如果依然安装失败,则可以使用easy_install-3.6.exe命令进行在线安装,步骤与上面基本一致。
离线安装时需要去官网上下载BeautifulSoup4的安装包,然后解压到某一个文件夹下。然后进入该文件夹,打开cmd,切换到刚刚解压完的文件夹下。使用Python install beautifulsoup4进行安装。
所以在3.4+的版本上安装beautifulsoup4时会出现如下错误:
解决办法是:
使用在线安装的步骤如下:
(1)进入Python的安装目录,找到Scripts文件夹,然后进入里面,可以看到如下可执行文件(我使用的Python3.6.x):
(2)如果之前安装过,切安装失败,则首先执行以下命令卸载beautifulsoup4:
pip install beautifulsoup4
(3)使用pip3.6.exe安装beautifulsoup4,记住一定不要使用pip.exe进行安装,不然还会出现版本不同的问题。(当然如果你使用的是2.x的版本,那么你可以使用pip.exe进行安装)
安装命令:pip3.6 install beautifulsoup4
(4)如果出现如下结果则表示安装成功:
到这里在线安装beautifulsoup4基本结束。
可以在Python环境下使用from bs4 import BeautifulSoup验证是否成功安装,如果没有错误出现,那么就表示已经安装成功了。
如果依然安装失败,则可以使用easy_install-3.6.exe命令进行在线安装,步骤与上面基本一致。
离线安装时需要去官网上下载BeautifulSoup4的安装包,然后解压到某一个文件夹下。然后进入该文件夹,打开cmd,切换到刚刚解压完的文件夹下。使用Python install beautifulsoup4进行安装。
相关文章推荐
- Windows下使用BeautifulSoup 出现You are trying to run the Python 2 version of Beautiful Soup under Python
- Windows下Python3安装BeautifulSoup4显示'You are trying to run the Python 2 version of Beautiful Soup under
- 错误 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.'<>
- You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.
- 使用FABridge时,出现You are trying to call recursively into the Flash Player which is not allowed…错误的处理
- windows安装python出现A program run as part of the setup did not finish as expected 的解决办法
- Python 3.0安装BeautifulSoup插件并使用 与Python 2 version of Beautiful Soup under Python 3问题处理
- Python——Windows安装Python出现A program run as part of the setup did not finish as expected的解决办法
- Windows环境下Python使用pip安装部分包出现错误的解决方案
- 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?
- You are attempting to build with the incorrect version of java.
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误 [转]
- You are attempting to build with the incorrect version of java.
- 解决错误:unable to find a version of the runtime to run this application
- Apache 安装出现 Failed to open the Windows service manager, perhaps you forgot to log in as Adminstrator
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- 修改ListItem时出现Error: Invalid data has been used to update the list item. The field you are trying to update may be read only.
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误