zoukankan      html  css  js  c++  java
  • 使用pip安装BeautifulSoup4模块

    1.测试是否安装了BeautifulSoup4模块

    import bs4
    print bs4

    执行报错说明没有安装该模块

    Traceback (most recent call last):
      File "D:work_javapythonsrcaike_spider	est.py", line 7, in <module>
        import bs4
    ImportError: No module named bs4

    2.使用pip安装BeautifulSoup4模块

     C:Python27Scripts 的目录
    
    2015/09/11  09:51    <DIR>          .
    2015/09/11  09:51    <DIR>          ..
    2015/09/11  09:51            95,592 easy_install-2.7.exe
    2015/09/11  09:51            95,592 easy_install.exe
    2015/09/11  09:51            95,564 pip.exe
    2015/09/11  09:51            95,564 pip2.7.exe
    2015/09/11  09:51            95,564 pip2.exe
                   5 个文件        477,876 字节
                   2 个目录 75,941,163,008 可用字节
    
    C:Python27Scripts>pip install beautifulsoup4
    You are using pip version 7.0.1, however version 8.0.2 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Collecting beautifulsoup4
      Downloading beautifulsoup4-4.4.1-py2-none-any.whl (81kB)
        100% |████████████████████████████████| 81kB 111kB/s
    Installing collected packages: beautifulsoup4
    Successfully installed beautifulsoup4-4.4.1

    2.再重新测试正常

    <module 'bs4' from 'C:Python27libsite-packagess4\__init__.pyc'>
  • 相关阅读:
    WEB功能测试说明
    年轻的采访可以学到很多东西
    金融系列11《电子现金应用》
    vs2010调用matlab2011下的.m文件
    使用VS2010调用matlab的mat格式文件
    matlab mex入门简介
    MEX文件编写和调试
    MAT文件操作
    8.Redis 数据备份与恢复
    JAVA_OPTS设置
  • 原文地址:https://www.cnblogs.com/myrunning/p/5159509.html
Copyright © 2011-2022 走看看