abhishek-ram / django-pyas2

AS2 file transfer Server built on Python and Django.
https://django-pyas2.readthedocs.io
GNU General Public License v3.0
78 stars 31 forks source link

Python3 - ImportError raised when trying to load 'pyas2.templatetags.pyas2_extras': No module named 'cStringIO' #61

Closed elasticdotventures closed 3 years ago

elasticdotventures commented 3 years ago

does pyAs2 require python2 or support python3? Looks like cStringIO was removed in Python3.

python3 manage.py migrate Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/django/template/utils.py", line 66, in getitem return self._engines[alias] KeyError: 'django'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 121, in get_package_libraries module = import_module(entry[1]) File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/usr/local/lib/python3.8/dist-packages/pyas2/templatetags/pyas2_extras.py", line 2, in from pyas2 import pyas2init File "/usr/local/lib/python3.8/dist-packages/pyas2/pyas2init.py", line 5, in from pyas2 import as2utils File "/usr/local/lib/python3.8/dist-packages/pyas2/as2utils.py", line 13, in from cStringIO import StringIO ModuleNotFoundError: No module named 'cStringIO'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "manage.py", line 22, in execute_from_command_line(sys.argv) File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 401, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 330, in run_from_argv self.execute(*args, cmd_options) File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 371, in execute output = self.handle(*args, *options) File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 85, in wrapped res = handle_func(args, kwargs) File "/usr/local/lib/python3.8/dist-packages/django/core/management/commands/migrate.py", line 75, in handle self.check(databases=[database]) File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 392, in check all_issues = checks.run_checks( File "/usr/local/lib/python3.8/dist-packages/django/core/checks/registry.py", line 70, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/usr/local/lib/python3.8/dist-packages/django/contrib/admin/checks.py", line 78, in check_dependencies for engine in engines.all(): File "/usr/local/lib/python3.8/dist-packages/django/template/utils.py", line 90, in all return [self[alias] for alias in self] File "/usr/local/lib/python3.8/dist-packages/django/template/utils.py", line 90, in return [self[alias] for alias in self] File "/usr/local/lib/python3.8/dist-packages/django/template/utils.py", line 81, in getitem engine = engine_cls(params) File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 25, in init options['libraries'] = self.get_templatetag_libraries(libraries) File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 43, in get_templatetag_libraries libraries = get_installed_libraries() File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 108, in get_installed_libraries for name in get_package_libraries(pkg): File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 123, in get_package_libraries raise InvalidTemplateLibrary( django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'pyas2.templatetags.pyas2_extras': No module named 'cStringIO'

elasticdotventures commented 3 years ago

Note: appears that I had the legacy "pyas2" that only supports Python2.7 installed in this instance.