2017-09-11 16 views
0

は、私は、Pythonに次のコードを試した:は "tldextractという名前のモジュールが"

from newspaper import Article 

#A new article from BBC 
url = "http://www.bbc.com/news/magazine-26935867" 

#For different language newspaper refer above table 
BBC_article = Article(url, language="en") # en for English 

そして私はエラー次取得しています:

Traceback (most recent call last): File "news_paper_article.py", line 3, in from newspaper import Article

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/newspaper/init.py", line 10, in from .article import Article, ArticleException

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/newspaper/article.py", line 12, in from . import images File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/newspaper/images.py", line 21, in from . import urls

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/newspaper/urls.py", line 16, in from tldextract import tldextract ImportError: No module named tldextract

それは簡単な問題かもしれないが、私はちょうど始めると、どんな助けもありがとう。

答えて

1

で試してみてください:

pip install tldextract 
+0

はfloatingpurrありがとうございます。これは助けられましたが、今私は次のエラーがあります。 msgstr "lxml.etreeというモジュールはありません" msgid。私は "pip install lxml.etree"を試してみましたが、 "lxml.etreeの要件を満たすダウンロードが見つかりませんでした" – learingstuff

+0

あなたはようこそ。別の問題を議論するために別の投稿を開いてください。 – floatingpurr

+0

'pip install lxml'で既に試しましたか? – floatingpurr

関連する問題