Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Fix ImportError on Python2.6 #181

Closed
wants to merge 1 commit into from
Closed

Fix ImportError on Python2.6 #181

wants to merge 1 commit into from

Conversation

mzabuawala
Copy link

@mzabuawala mzabuawala commented Sep 8, 2017

Hi,

We were using Flask-Script-2.0.5 earlier without an issue but due to recent dependancy change to version Flask-Script-2.0.6, we are now force to use newer version which does not work with Python2.6, We need support of Python2.6 for CentOS 6.

Details:

    import flask_migrate
  File "/var/lib/jenkins/workspace/py_code-master-python26/py_code-venv/lib/python2.6/site-packages/flask_migrate/__init__.py", line 4, in <module>
    from flask_script import Manager
  File "/var/lib/jenkins/workspace/py_code-master-python26/py_code-venv/lib/python2.6/site-packages/flask_script/__init__.py", line 10, in <module>
    from collections import OrderedDict
ImportError: cannot import name OrderedDict

Added fallback for Python2.6
@davidism
Copy link

davidism commented Sep 8, 2017

The package ordereddict is not a built-in, so this would require a new dependency, probably not what you meant to do. The solution here is to revert whatever patch added the OrderedDict.

But the real solution is to upgrade from Python 2.6.

@mzabuawala
Copy link
Author

mzabuawala commented Sep 8, 2017

Yes, we know that ordereddict is not a built-in package but for Python2.6 that is available as a replacement of OrderedDict.

We can't upgrade python because it will break CentOS6.
https://superuser.com/questions/1027526/upgrade-python-from-2-6-to-2-7-on-centos-6-5

@anthraxx
Copy link
Collaborator

anthraxx commented Sep 8, 2017 via email

@davidism
Copy link

davidism commented Sep 8, 2017

You don't have to upgrade the system python, more than one version can live side by side.

@davidism
Copy link

davidism commented Sep 8, 2017

Again, this can be solved without the extra package, you just need to revert whatever added the ordereddict. I'm not sure if that's worth it though. If you need Flask-Script on 2.6 you can always just keep using the previous version.

@mzabuawala
Copy link
Author

mzabuawala commented Sep 9, 2017

Ok, I'll change the requirement.txt accordingly.
Thanks.

@mzabuawala mzabuawala closed this Sep 9, 2017
@anthraxx
Copy link
Collaborator

anthraxx commented Sep 9, 2017 via email

@mzabuawala
Copy link
Author

We do use CentOS 7, however we have thousands of downloads per year from CentOS 6 users, and we know that many of our customers still use RHEL 6 which is in support for a number of years yet for Enterprise users who may not be in a position to upgrade. This is extremely common in many industries in which our software is used.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants