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:

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.

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.