Using pybedtools under Python 2.6

I encountered an import error from collections import OrderedDict, while using pybedtools under Python 2.6. It took me some time to find a workaround… I posted it below.
# install dependencies and pybedtools
pip install cython ordereddict
pip install pybedtools

# edit file … lib/python2.6/site-packages/pybedtools/contrib/
# comment import from collections and add try-except
#from collections import OrderedDict
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s