无法运行uwsgi --myproject.ini。 获取的错误:ImportError:无法导入名称_remove_dead_weakref
我试图用uwsgi下的virtualenv运行django项目
myproject.ini
[uwsgi]
home = /var/virtualenv/myproject
chdir = /var/virtualenv/myproject/www
module = project.wsgi
plugins = python
master = true
processes = 4
no-orphans = true
socket = /var/virtualenv/myproject/config/project.sock
pidfile = /var/virtualenv/myproject/config/pid
log-date = true
chmod-socket = 666
vacuum = true
touch-reload = /var/virtualenv/myproject/config/touchme
跟踪:
File "./project/wsgi.py", line 12, in <module>
from django.core.wsgi import get_wsgi_application
File "/var/virtualenv/myproject/lib/python2.7/site-packages/django/core/wsgi.py", line 2, in <module>
from django.core.handlers.wsgi import WSGIHandler
File "/var/virtualenv/myproject/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 8, in <module>
from django import http
File "/var/virtualenv/myproject/lib/python2.7/site-packages/django/http/__init__.py", line 1, in <module>
from django.http.cookie import SimpleCookie, parse_cookie
File "/var/virtualenv/myproject/lib/python2.7/site-packages/django/http/cookie.py", line 6, in <module>
from django.utils.encoding import force_str
File "/var/virtualenv/myproject/lib/python2.7/site-packages/django/utils/encoding.py", line 10, in <module>
from django.utils.functional import Promise
File "/var/virtualenv/myproject/lib/python2.7/site-packages/django/utils/functional.py", line 1, in <module>
import copy
File "/usr/local/lib/python2.7/copy.py", line 52, in <module>
import weakref
File "/usr/local/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref