NameError: name 'sys_platform' is not defined
See original GitHub issueI’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
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:19 (2 by maintainers)
Top Results From Across the Web
NameError: name 'sys_platform' is not defined - Stack Overflow
This problem is solved by using enpkg setuptools and enpkg pip . I GUESS the problem may be caused by sth. related to...
Read more >NameError: name 'sys' is not defined in Python | bobbyhadz
The Python "NameError: name 'sys' is not defined" occurs when we use the sys module without importing it first. To solve the error,...
Read more >NameError: name 'sys' is not defined · Issue #12745 - GitHub
Got the below error when I use this code snipets, In [1]: from elasticsearch import Elasticsearch In [2]: es = Elasticsearch(hosts=[{"host": ...
Read more >Common issues and solutions - mypy 0.991 documentation
NameError: name "X" is not defined from forward references. TypeError: 'type' object is not subscriptable from types that are not generic at runtime....
Read more >sys — System-specific parameters and functions — Python ...
If the command was executed using the -c command line option to the interpreter, argv[0] is set to the string '-c' . If...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Same issue here.
pip install --upgrade distributefixed 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-dirto 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.