“模組”物件沒有屬性“PY2”

“模組”物件沒有屬性“PY2”

我正在使用 ubuntu 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。升級此模組,您將再次啟動並運行。

相關內容