0

hey all, I'm trying to integrate sqlalchemy into my project build rather than install it separate.

so in my project i have "<project_dir>/lib/sqlalchemy/*"

i put a the __init__.py in "lib"

but when i try to do from lib.sqlalchemy import * i get:

---------------------------------------------------------------------------
ImportError Traceback (most recent call last)

/home/dankles/workspace/ac/src/AniChou/<ipython console> in <module>()

/home/dankles/workspace/ac/src/AniChou/lib/sqlalchemy/__init__.py in <module>()
8 import sys
9
---> 10 import sqlalchemy.exc as exceptions
11 sys.modules = exceptions
12

ImportError: No module named sqlalchemy.exc

How ever if I'm in the "lib" dir and type: from sqlalchemy import * I get no such problem

this is probably a newb question, but I'm cunfused and don't know what to do... :rolleyes:

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by woooee
0

ImportError: No module named sqlalchemy.exc

Is the program/file actually named "sqlalchemy.exc". Looks like it's maybe a typo. Also, import usually assumes a ".py" ending.

0

exc is just a module within sqlalchemy that I'd wanna import along with everything else.

0

exc is just a module within sqlalchemy that I'd wanna import along with everything else.

Then I think you want
from sqlalchemy import exc
but I don't use sqlalchemy. In any case,
from lib.sqlalchemy import * is different from
from sqlalchemy import * so I would suggest trying the latter first, and if that works then there is something wrong with the "exc" wording.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.