使用 Python 2.7、django 和 virtualenv,每当我尝试运行 python manage.py validate 时都会收到以下错误。仅供参考,我已经激活了 python 的 virtualenv 和文件路径,并且站点包似乎是正确的。
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/core/management/__init__.py", line 263, in fetch_command
app_name = get_commands()[subcommand]
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/core/management/__init__.py", line 109, in get_commands
apps = settings.INSTALLED_APPS
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
self._configure_logging()
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/conf/__init__.py", line 71, in _configure_logging
from django.utils.log import DEFAULT_LOGGING
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/utils/log.py", line 6, in <module>
from django.views.debug import ExceptionReporter, get_exception_reporter_filter
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/views/debug.py", line 11, in <module>
from django.http import (HttpResponse, HttpResponseServerError,
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/http/__init__.py", line 2, in <module>
from django.http.request import (HttpRequest, QueryDict, UnreadablePostError,
File "/home/bitnami/Sites/env.example/lib/python2.7/site-packages/django/http/request.py", line 8, in <module>
from io import BytesIO
File "/opt/bitnami/python/lib/python2.7/io.py", line 60, in <module>
import _io
ImportError: /home/bitnami/Sites/env.example/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyUnicodeUCS2_AsEncodedString