codelucas / newspaper

newspaper3k is a news, full-text, and article metadata extraction in Python 3. Advanced docs:
https://goo.gl/VX41yK
MIT License
14.06k stars 2.11k forks source link

ImportError: No module named request #259

Closed mavarick closed 8 years ago

mavarick commented 8 years ago

when i import newspaper in ipython, it turns out:

In [3]: import newspaper

ImportError Traceback (most recent call last)

in () ----> 1 import newspaper /Users/mavarick/anaconda/lib/python2.7/site-packages/newspaper/**init**.py in () 8 **copyright** = 'Copyright 2014, Lucas Ou-Yang' 9 ---> 10 from .article import Article, ArticleException 11 from .api import (build, build_article, fulltext, hot, languages, 12 popular_urls, NewsPool, Configuration as Config) /Users/mavarick/anaconda/lib/python2.7/site-packages/newspaper/article.py in () 10 import glob 11 ---> 12 from . import images 13 from . import network 14 from . import nlp /Users/mavarick/anaconda/lib/python2.7/site-packages/newspaper/images.py in () 13 import io 14 import traceback ---> 15 import urllib.request 16 import urllib.parse 17 import urllib.error ImportError: No module named request What's Wrong?
yprez commented 8 years ago

How did you install newspaper? It looks like the newspaper3k version which doesn't support Python 2...

mavarick commented 8 years ago

yeah,it only support python3, it works well in python3 env.