Skip to content

UserDict import fails on Python 2.6 if six is too old #376

@peterjc

Description

@peterjc

I just updated planemo, and ran into a dependency problem under Python 2.6:

$ planemo --version
planemo, version 0.20.1.dev0
$ planemo shed_diff -t toolshed tools/ncbi_blast_plus/
Problem loading command shed_diff, exception cannot import name UserDict
Usage: planemo [OPTIONS] COMMAND [ARGS]...

Error: No such command "shed_diff".

The UserDict class moved from Python 2 to 3, which ought to be handled by from six.moves import UserDict as used in planemo_ext/galaxy/util/odict.py, however my version of six is too old:

$ python
Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from six.moves import UserDict
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name UserDict
>>> import six
>>> six.__version__
'1.6.1'

Therefore I think that requirements.txt should set a minimum version of six. The UserDict move was added in version 1.7.0, the current version is 1.10.0.

I manually updated to six v1.10.0 and reinstalled planemo, and this works again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions