使用pip安装BeautifulSoup4模块
生活随笔
收集整理的這篇文章主要介紹了
使用pip安装BeautifulSoup4模块
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.測試是否安裝了BeautifulSoup4模塊
import bs4 print bs4執行報錯說明沒有安裝該模塊
Traceback (most recent call last):File "D:\work_java\python\src\baike_spider\test.py", line 7, in <module>import bs4 ImportError: No module named bs4?
2.使用pip安裝BeautifulSoup4模塊
C:\Python27\Scripts 的目錄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.exe5 個文件 477,876 字節2 個目錄 75,941,163,008 可用字節C:\Python27\Scripts>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 beautifulsoup4Downloading 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:\Python27\lib\site-packages\bs4\__init__.pyc'>?
轉載于:https://www.cnblogs.com/myrunning/p/5159509.html
總結
以上是生活随笔為你收集整理的使用pip安装BeautifulSoup4模块的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mac 10.11 安装mysql5.7
- 下一篇: 参数--argumengs