Forums

error pip install

I am getting this error trying to install newspaper

Downloading/unpacking newspaper
  Downloading newspaper-0.0.8.tar.gz (6.9MB): 6.9MB downloaded
  Running setup.py (path:/tmp/pip_build_Cmaden/newspaper/setup.py) egg_info for package newspaper
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_Cmaden/newspaper/setup.py", line 51, in <module>
        zip_safe=False,
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 225, in __init__
        _Distribution.__init__(self,attrs)
      File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 257, in finalize_options
        ep.require(installer=self.fetch_build_egg)
      File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2099, in require
        working_set.resolve(self.dist.requires(self.extras),env,installer))
      File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2309, in requires
        dm = self._dep_map
      File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2538, in _dep_map
        self.__dep_map = self._compute_dependencies()
      File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2571, in _compute_dependencies
        common = frozenset(reqs_for_extra(None))
      File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2568, in reqs_for_extra
        if req.marker_fn(override={'extra':extra}):
      File "/usr/local/lib/python2.7/dist-packages/_markerlib/markers.py", line 109, in marker_fn
        return eval(compiled_marker, environment)
      File "<environment marker>", line 1, in <module>
    NameError: name 'sys_platform' is not defined
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_Cmaden/newspaper/setup.py", line 51, in <module>

    zip_safe=False,

  File "/usr/lib/python2.7/distutils/core.py", line 111, in setup

    _setup_distribution = dist = klass(attrs)

  File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 225, in __init__

    _Distribution.__init__(self,attrs)

  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__

    self.finalize_options()

  File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 257, in finalize_options

    ep.require(installer=self.fetch_build_egg)

  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2099, in require

    working_set.resolve(self.dist.requires(self.extras),env,installer))

  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2309, in requires

    dm = self._dep_map

  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2538, in _dep_map

    self.__dep_map = self._compute_dependencies()

  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2571, in _compute_dependencies

    common = frozenset(reqs_for_extra(None))

  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2568, in reqs_for_extra

    if req.marker_fn(override={'extra':extra}):

  File "/usr/local/lib/python2.7/dist-packages/_markerlib/markers.py", line 109, in marker_fn

    return eval(compiled_marker, environment)

  File "<environment marker>", line 1, in <module>

NameError: name 'sys_platform' is not defined

Did you use the --user flag as descibed here?

Yes I did

That's strange. It works for me. What do you see when you do:

ls ~/.local/lib/python2.7/site-packages/
10:51 ~/.local/lib/python2.7/site-packages $ ls

django_appconf-0.6-py2.7.egg             easy-install.pth           python_mimeparse-0.1.4-py2.7.egg-info    tastypie
django_cors_headers-0.13-py2.7.egg-info  grappelli                  pytz                                     timestring
django_grappelli-2.5.3-py2.7.egg-info    jieba                      pytz-2013b-py2.7.egg-info                timestring-1.6.1-py2.7.egg-info
django_staticfiles-1.2.1-py2.7.egg       jieba-0.35-py2.7.egg-info  readability
django_subdomains-2.0.4-py2.7.egg-info   mimeparse.py               readability_lxml-0.3.0.3-py2.7.egg-info
django_tastypie-0.11.1.dist-info         mimeparse.pyc              subdomains

this is what I see when i run pip install --user goose-extractor

Hm, that's odd. It could be to do with packages you've pip installed in the past, or some kind of conflict with the system ones.

Can I suggest you switch to using a virtualenv? That would give you an environment that's isolated from the rest of the system, and things you've installed before. There are some instructions for how to do it with django here, but they can be adapted to any framework:

https://www.pythonanywhere.com/wiki/VirtualEnvForNewerDjango