2017-02-02 21 views
-1

我不知道發生了什麼事,但無論我嘗試過什麼,當我去import bs4該模塊未找到。我不知道如何才能找到包裹。美麗的湯不能被發現多次重新安裝

Traceback (most recent call last): 
    File "/Users/tonywinglau/Desktop/print('hello LeChristopher').py", line 1, in <module> 
    import bs4 as bs 
ImportError: No module named bs4 
[Finished in 0.1s with exit code 1] 
[cmd: ['/usr/bin/python2.7', "/Users/tonywinglau/Desktop/print('helloLeChristopher').py"]] 
[dir:/Users/tonywinglau/Desktop] 
[path:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin] 
+0

可能[重複](http://stackoverflow.com/questions/11783875/importerror-no-module-named-bs4-beautifulsoup)。 – blacksite

+0

你可以嘗試導入BeautifulSoup –

+0

不只是'導入BeautifulSoup'不起作用 –

回答

0

在我的全球環境中,我不能說這個問題已經解決,但安裝virtualenv工作。運行沒有錯誤 - 通過virtualenv myproject && pip install BeautifulSoup


import BeautifulSoup創建了某個虛擬環境之後。