Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support python 3 #251

Closed
filipp-codes opened this issue Apr 6, 2021 · 3 comments
Closed

Doesn't support python 3 #251

filipp-codes opened this issue Apr 6, 2021 · 3 comments

Comments

@filipp-codes
Copy link

filipp-codes commented Apr 6, 2021

I'm getting invalid syntax error when starting ckan.
"except ValueError, e:" - this syntax is not correct in python 3, but there is no information in docs that plugin working only with python 2.

Possible solutions:
Solution 1: fix syntax to "except ValueError as e:"
Solution 2: mention in documentation that it's not working with python 3.

Traceback (most recent call last):
  File "/etc/ckan/default/wsgi.py", line 12, in <module>
    application = make_app(config)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 56, in make_app
    load_environment(conf)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 123, in load_environment
    p.load_all()
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 155, in load_all
    load(*plugins)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 169, in load
    service = _get_service(plugin)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 271, in _get_service
    return plugin.load()(name=plugin_name)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/ckan/default/src/ckanext-spatial/ckanext/spatial/plugin.py", line 113
    except ValueError, e:
                     ^
SyntaxError: invalid syntax
unable to load app 0 (mountpoint='') (callable not found or import error)

@bonnland
Copy link
Contributor

bonnland commented Apr 20, 2021

I'm running into the same issue. I found this discussion on the migration to Python 3:

https://github.com/ckan/ckan/wiki/Python-3-migration-guide-for-extensions

See issue #238 also.

@bonnland
Copy link
Contributor

Also just found #249

@amercader
Copy link
Member

Python 3 support was added as part of #249. You can use the v1.0.0 tag onward to get Python 3 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants