'모듈' 개체에 'PY2' 속성이 없습니다.

'모듈' 개체에 'PY2' 속성이 없습니다.

저는 우분투 14.04를 사용하고 있으며 python-memcache를 설치하려고 했습니다. 다음과 같은 오류가 발생했습니다.

Downloading/unpacking python-memcached
  Downloading python-memcached-1.53.tar.gz
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1229, in prepare_files
    req_to_install.run_egg_info()
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 292, in run_egg_info
    logger.notify('Running setup.py (path:%s) egg_info for package %s' % (self.setup_py, self.name))
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 284, in setup_py
    if six.PY2 and isinstance(setup_py, six.text_type):
AttributeError: 'module' object has no attribute 'PY2'

Storing debug log for failure in /home/mani/.pip/pip.log

Django-celery, pymongo 등을 설치할 때 동일한 오류가 발생합니다.

답변1

설치된 Python 모듈 6은 매우 오래되었습니다. Python 인터프리터 내에서

import six
six.__version__

현재 버전은 1.7.3이고, 12.10 Ubuntu 시스템에서는 기본값이 1.1.0입니다. 이 모듈을 업그레이드하면 다시 작동할 수 있습니다.

관련 정보