@SerjAntiquity
учу python

Как убрать ошибку при импорте модуля Flask-OpenID, python3?

Приветствую, пытаюсь импортировать модуль, но он выдаёт ошибку:
In[17]: from flask.ext.openid import OpenID
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 2821, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-17-f6203321d602>", line 1, in <module>
    from flask.ext.openid import OpenID
  File "/opt/pycharm/helpers/pydev/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "/usr/local/lib/python3.4/dist-packages/flask/exthook.py", line 62, in load_module
    __import__(realname)
  File "/opt/pycharm/helpers/pydev/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/flask_openid.py", line 25, in <module>
    from openid.store.filestore import FileOpenIDStore
  File "/opt/pycharm/helpers/pydev/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/opt/pycharm/helpers/pydev/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/opt/pycharm/helpers/pydev/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/openid/__init__.py", line 52, in <module>
    if len(version_info) != 3:
TypeError: object of type 'map' has no len()


__version__ = '[library version:2.2.1]'[17:-1]

....
....

# Parse the version info
try:
    version_info = map(int, __version__.split('.'))
except ValueError:
    version_info = (None, None, None)
else:
    if len(version_info) != 3:
        version_info = (None, None, None)
    else:
        version_info = tuple(version_info)

что я делаю не так?
  • Вопрос задан
  • 646 просмотров
Решения вопроса 1
@SerjAntiquity Автор вопроса
учу python
version_info = list(map(int, __version__.split('.')))
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы