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

Problem with nltk dependency #244

Closed ghost closed 8 years ago

ghost commented 8 years ago

Working in a virtualenv, python 3.4.3.

Running pip install newspaper gives me:

 error: invalid command 'bdist_egg'
    /tmp/pip-build-d_0h2zij/nltk/distribute-0.6.21-py3.4.egg
    Traceback (most recent call last):
      File "/tmp/pip-build-d_0h2zij/nltk/distribute_setup.py", line 143, in use_setuptools
        raise ImportError
    ImportError

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-d_0h2zij/nltk/setup.py", line 23, in <module>
        distribute_setup.use_setuptools()
      File "/tmp/pip-build-d_0h2zij/nltk/distribute_setup.py", line 145, in use_setuptools
        return _do_download(version, download_base, to_dir, download_delay)
      File "/tmp/pip-build-d_0h2zij/nltk/distribute_setup.py", line 125, in _do_download
        _build_egg(egg, tarball, to_dir)
      File "/tmp/pip-build-d_0h2zij/nltk/distribute_setup.py", line 116, in _build_egg
        raise IOError('Could not build the egg.')
    OSError: Could not build the egg.
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-d_0h2zij/nltk/

I have made sure to update setuptools in both the virtualenv and the system-wide installation, no joy.

Any reason why the install script isn't finding it? Curiously, nltk installs just fine by itself, but evidently the version that newspaper requires isn't installing? Am I understanding that correctly?

yprez commented 8 years ago

I think you're installing the wrong version of newspaper... the Python 3 version is newspaper3k. Can you try: pip install newspaper3k?

ghost commented 8 years ago

Gnarly, thanks. That was it.

This is OT, but why would it throw an import error from w/rspct to setuptools?

yprez commented 8 years ago

Uhm, not really sure, I just remember there was some issue with installing the latest nltk on python2, so that's the first thing that fails...

ghost commented 8 years ago

Well thanks for steering me forward

stetelepta commented 7 years ago

This helped me too, thanks!