I\'m trying to use alembic which is an sqlalchemy tool in python. You type a command and it generates a folder \"alembic\" with py files inside. The py file inside, needs to lin
Is myapp
a self-contained application, or a sub-application such as ones that you can find using Django? If it's a self-contained app, then you're kinda going about things wrong. What you really want to do is to install the dependencies that your app has in order to be able to access them without having to use relative imports and the like (which is bad practice, especially if anyone but you is using the app).
What you likely will want to do (again, if it's self-contained):
alembic
as a dependency: pip install alembic
requirements.txt
file: pip freeze > requirements.txt
Now, you should be able to use alembic via import alembic
from anywhere within your project.
Edit:
Your directory structure is also a little wonky. You'll want to put all of your app-specific modules into another myapp
subdirectory:
myapp
myapp
__init__.py
configs/__init__.py
The reason for this is so that you can add myapp
to your PYTHONPATH
and be able to import any modules from your app via from myapp import foo
. As it stands, if myapp
is on your PYTHONPATH
, you'll only be able to access the submodules from the second namespace level (i.e. import configs
), which is bad for obvious reasons.