VirtualEnv无法导入名称包装

2024-09-27 21:22:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我想弄清楚为什么我的djagnowsgi脚本不能运行。它在普通python下运行良好,但virtualenv生成以下堆栈跟踪:

(virtualenv)... [~]# python djangosites/test1.wsgi
Traceback (most recent call last):
  File "djangosites/test1.wsgi", line 13, in <module>
    from django.core.handlers.wsgi import WSGIHandler
  File "/home/myofirst/virtualenv/lib/python2.6/site-packages/Django-1.2.3-py2.6.egg/django/core/handlers/wsgi.py", line 1, in <module>
    from threading import Lock
  File "/opt/python2.6/lib/python2.6/threading.py", line 13, in <module>
    from functools import wraps
ImportError: cannot import name wraps

看来我需要安装functools了。我通过easy-install尝试了这个方法,现在pip和easy-install都无法运行,它们都抱怨缺少wraps。我需要安装/卸载什么来解决此问题?在


Tags: djangoinfromcoreimportwsgivirtualenvlib

热门问题