pip: NameError: name 'sys_platform' is not defined
I’m getting lots of errors like this when installing packages recently. I am on pip 7.0.3
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/nh/1d2kqct94cv5144g627_yty40000gn/T/pip-build-i4Snhb/contextdecorator/setup.py", line 56, in <module>
classifiers=CLASSIFIERS,
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 137, in setup
ok = dist.parse_command_line()
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-packages/setuptools/dist.py", line 276, in parse_command_line
result = _Distribution.parse_command_line(self)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 467, in parse_command_line
args = self._parse_command_opts(parser, args)
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-packages/setuptools/dist.py", line 602, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 523, in _parse_command_opts
cmd_class = self.get_command_class(command)
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-packages/setuptools/dist.py", line 406, in get_command_class
ep.require(installer=self.fetch_build_egg)
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-packages/pkg_resources.py", line 2272, in require
working_set.resolve(self.dist.requires(self.extras),env,installer)))
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-packages/pkg_resources.py", line 2489, in requires
dm = self._dep_map
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-packages/pkg_resources.py", line 2700, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-packages/pkg_resources.py", line 2733, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-packages/pkg_resources.py", line 2730, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/Users/paul/.virtualenvs/anentropic/lib/python2.7/site-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
----------------------------------------
Failed building wheel for contextdecorator
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 19 (2 by maintainers)
Same issue here.
pip install --upgrade distribute
fixed it.Had the same error.
But since it looked like the error was generated when pip is trying to build a wheel cache, I tried disabling that by adding the
--no-cache-dir
to thepip install ..
and it worked for me.Sounds like a better and sensible solution to me than upgrading setuptools etc. Regarding the error itself - Not sure what / why exactly pip is complaining about … but I think that pip should be handling this better.