No module named bs4 說我沒有裝bs4.
Traceback (most recent call last):
? File "D:\C temp\Desktop\python test files\1.22.py", line 2, in <module>
? ? from bs4 import BeautifulSoup
ImportError: No module named bs4
[Finished in 1.1s with exit code 1]
[cmd: ['D:/Python27/python.exe', '-u', 'D:\\C temp\\Desktop\\python test files\\1.22.py']]
[dir: D:\C temp\Desktop\python test files]
[path: C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;D:\Program Files\Windows7Master;D:\Program Files (x86)\Sublime Text 3;D:\Users\joey\Anaconda2;d:\Users\joey\Anaconda2;d:\Users\joey\Anaconda2\Scripts;d:\Users\joey\Anaconda2\Library\bin]
我明明已經(jīng)通過?anaconda中的conda?install?beautifulsoup?安裝好了bs4,并且在交互界面下,分別?import?bs4?,from?bs4?import?BeautifulSoup?也沒問題,怎么在文本模式下,上圖那樣,就顯示我沒有裝bs4呢? 我用sublime?text3.
2016-09-14
應(yīng)該這樣安裝才行
2018-01-24
樓主,我研究了一個(gè)晚上,from bs4 import BeautifulSoup報(bào)錯(cuò)No module named 'bs4'問題,琢磨了一個(gè)方法。
首先,我使用的IDE是PyCharm Python版本3.6,在file選項(xiàng)中選擇settings選項(xiàng)點(diǎn)進(jìn)去
然后選擇Project Interpreter
雙擊pip點(diǎn)進(jìn)去
搜索ps4點(diǎn)擊 ? 然后點(diǎn)擊Install Package等會(huì)即可
應(yīng)該有用,但是我也是才學(xué)沒多久,方法也是在網(wǎng)上還是群里面看大佬們看出來的,希望對(duì)樓主有幫助。
2016-09-14
C:\Users\Administrator>pip install beautifulsoup4
Collecting beautifulsoup4
? Downloading beautifulsoup4-4.5.1-py3-none-any.whl (83kB)
??? 48% |███████████████▋??????????????? | 40kB 36kB/s eta 0:00:
??? 61% |███████████████████▌??????????? | 51kB 45kB/s eta 0
??? 73% |███████████████████████▍??????? | 61kB 54kB/s e
??? 85% |███████████████████████████▍??? | 71kB 50kB
??? 97% |███████████████████████████████▎| 81kB
??? 100% |████████████████████████████████| 92kB
?63kB/s
Installing collected packages: beautifulsoup4
Successfully installed beautifulsoup4-4.5.1