1

Using Python 2.7, django and virtualenv, I get the following error whenever, I try to run python manage.py validate. FYI, I already activated the virtualenv and filepath to python and site packages seems correct.

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
tank
  • 319
  • 6
  • 15
  • Strange error. Did you compile Python yourself? I m trying to understand what ``Sites/env.lawful.ly/lib/python2.7/lib-dynload/_io.so`` is? which comes from ``File "/opt/bitnami/python/lib/python2.7/io.py",`` – CppLearner Apr 24 '13 at 02:00
  • No. I am using Bitnami Django stack. Python is pre-install – tank Apr 24 '13 at 02:09
  • Oh neverheard of Bitnami. You probably can get better support on their site. I would trust native python and django stack. – CppLearner Apr 24 '13 at 02:22
  • related: https://stackoverflow.com/questions/11878666/python-undefined-symbol-pyunicodeucs2-decodeutf8 – Ciro Santilli OurBigBook.com Apr 23 '20 at 11:35

1 Answers1

1

Could you executefirst the following?

. /opt/bitnami/scripts/setenv.sh (notice the space between the dot and the path to the script). This would load the libraries in BitNami environment.

kaysa
  • 1,491
  • 13
  • 9