Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError with Python 3 and Django 1.8 #38

Closed
mpwoodward opened this issue Apr 27, 2015 · 3 comments
Closed

ImportError with Python 3 and Django 1.8 #38

mpwoodward opened this issue Apr 27, 2015 · 3 comments

Comments

@mpwoodward
Copy link

This may be something Django-specific but thought I'd ask here in addition to on the Django list.

On Ubuntu Server 14.04 64-bit, Python 3.4, and pyodbc 3.0.8 (which I believe is the only version that works with Python 3?), pyodbc installs fine, and works fine from a regular Python interpreter, but fails in a Django shell.

For example if I do python3 and then import pyodbc, no problems.

If, however, I do python3 manage.py shell and then import pyodbc, I get the following:
http://pastebin.com/cNDrmvcb

Any ideas? Thanks.

@mkleehammer
Copy link
Owner

I am just now fixing a bug that causes this exact error when importing the decimal module. I was not clearing the import error after attempting to import "cdecimal", so it would fail to load. I'm not sure if it is the same, but I'll push the fix now and you can try. Sorry about that.

@mpwoodward
Copy link
Author

Thanks! About to give that a shot. Also seeing what apparently is an old encoding-related but (reported in https://code.google.com/p/pyodbc/issues/detail?id=110 on the old google code site) but I'll try this new version and create another issue if I can't get that one sorted out.

Really, really appreciate the quick response!

mkleehammer added a commit that referenced this issue Apr 27, 2015
Potential fix for #38.  pyodbc first tries to import cdecimal and then
loads decimal if not found.  The error after attempting cdecimal was not
being cleared so later versions of Python stopped the load.
@mpwoodward
Copy link
Author

That did the trick! Thanks SO MUCH!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants