Calibre now depend on OrderedDict which need python2.7

Bug #761226 reported by Hiroshi Miura on 2011-04-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

There is a build error on Ubuntu 10.10(Marverick) 64bit.
It is because calibre now 0.7.54(2011-04-08) depend on collections.OrderedDict that is supported after 2.7.
but minimum requirement of python version is 2.6.

We should not depend on collections.OrderedDict. We may be able to use ordereddict.OrderedDict that is backport
of collections.OrderedDict but it is introduced from Ubuntu natty(11.04).

A package name of library in Natty is 'python-ordereddict'

* Running resources

 Creating scripts.pickle
Traceback (most recent call last):
  File "", line 99, in <module>
  File "", line 85, in main
  File "/home/miurahr/Projects/calibre/bzr/packaging/setup/", line 159, in run_all
    self.run_cmd(self, opts)
  File "/home/miurahr/Projects/calibre/bzr/packaging/setup/", line 155, in run_cmd
  File "/home/miurahr/Projects/calibre/bzr/packaging/setup/", line 47, in run
    from import \
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/web/feeds/recipes/", line 8, in <module>
    from import BasicNewsRecipe, CustomIndexRecipe, \
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/web/feeds/", line 19, in <module>
    from calibre.ebooks.metadata.opf2 import OPFCreator
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/ebooks/metadata/", line 20, in <module>
    from import Metadata
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/ebooks/metadata/book/", line 17, in <module>
    from calibre.library.field_metadata import FieldMetadata
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/library/", line 7, in <module>
    from collections import OrderedDict
ImportError: cannot import name OrderedDict

Hiroshi Miura (miurahr) wrote :
John Schember (user-none) wrote :

Calibre has required Python 2.7 for quite some time. All calibre binary installs bundle Python 2.7. All calibre binary installs also bundle colletions. You will need to update the Python version install on Ubuntu. Python 2.7 specific features are used elsewhere.

Changed in calibre:
status: New → Invalid
Kovid Goyal (kovid) wrote :

python 2.7 features were needed as of version 0.7.51. I now try to maintain python 3 forward compatibility in new calibre code, which needed various features from 2.7, like orderedict, importlib, io.BystesIO etc. Maintaining private versions of these is too much work.

Incidentally, I hope the earthquake/tsunami did not affect you.

Hiroshi Miura (miurahr) wrote :
Hiroshi Miura (miurahr) wrote :

In it is written:

def check_version_info():
    vi = sys.version_info
    if vi[0] == 2 and vi[1] > 5:
        return None
    return 'calibre requires python >= 2.6'

It should be change to proper value.

Yes, I'm fine and so busy to operate which is ushahidi crisis response platform with other OSS developers.

Glad to hear it. I've fixed the function.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers