Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: 'module' object has no attribute 'python_implementation' running pip

Tags:

python

pip

cygwin

I installed Cygwin with Python set-up tools. When I try to run pip install awscli I get the following error:

$ pip install awscli
Traceback (most recent call last):
  File "/usr/bin/pip", line 8, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 318, in load_entry_point
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 2221, in load_entry_point
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 1954, in load
  File "/usr/lib/python2.5/site-packages/pip-1.5.4-py2.5.egg/pip/__init__.py", line 9, in <module>
    from pip.log import logger
  File "/usr/lib/python2.5/site-packages/pip-1.5.4-py2.5.egg/pip/log.py", line 9, in <module>
    from pip._vendor import colorama, pkg_resources
  File "/usr/lib/python2.5/site-packages/pip-1.5.4-py2.5.egg/pip/_vendor/pkg_resources.py", line 1112, in <module>
    class MarkerEvaluation(object):
  File "/usr/lib/python2.5/site-packages/pip-1.5.4-py2.5.egg/pip/_vendor/pkg_resources.py", line 1120, in MarkerEvaluation
    'python_implementation': platform.python_implementation,
AttributeError: 'module' object has no attribute 'python_implementation'

Am I missing something in my path or is my Python implementation hosed?

like image 430
user2344442 Avatar asked Mar 16 '14 15:03

user2344442


2 Answers

Similar to what others have posted, I got the same error from having a platform.py file (rather than directory). I renamed it and the error went.

like image 154
wobbily_col Avatar answered Sep 18 '22 20:09

wobbily_col


Do you have a folder called "/platform" inside your python app?

If you do, it will scope-shadow the native python "platform" module. When modules you're using try to get information about the system, they'll get a null object back. This will often cause errors like:

AttributeError: 'module' object has no attribute 'version'

AttributeError: 'module' object has no attribute 'machine'

AttributeError: 'module' object has no attribute 'python_implementation'

Simply rename the "/platform" folder to something else to resolve the problem.

like image 42
foxly Avatar answered Sep 21 '22 20:09

foxly