When using Alembic autogenerate command, we need to add a new module (mymodule) 
to $PYTHONPATH, and then configure env.py. $PYTHONPATH seems not stable. When I 
open an ubuntu terminal, and type: export 
PYTHONPATH=$PYTHONPATH:/home/mydir/mymodule, the new module is added into 
$PYTHONPATH variable. autogenerate command worked fine. But when I open a new 
ubuntun terminal, and check $PYTHONPATH, the new module mymodule was not there, 
and autogenerate command didn't work under this terminal. I don't know what is 
wrong.  

Another problem I encountered: I am one of users in an Ubuntu OS, and I can use 
'sudo bash' to get root permission. Another user, let us call usersupper, who 
installed alembic in that Ubuntu OS, but didn't configure it. I used root 
permission to configure it. THere is no problem to run 'alembic revision -m 
"create account table"', but failed to run 'alembic revision --autogenerate', 
and got error:
......
 module = imp.load_source(module_id, path, open(path, 'rb'))
  File "alembic/env.py", line 20, in <module>
    from mymodule import myschema
ImportError: No module named mymodule

but I did run command 'export PYTHONPATH=$PYTHONPATH:/home/mydir/mymodule' 
successfully. Is that permission problem? 

Please let me know if I didn't explain the problem clearly.
Thanks a lot in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/K2hx2poDG1cJ.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to