https://dagster.io/ logo
#dagster-support
Title
# dagster-support
k

Kevin Otte

02/06/2023, 4:02 PM
gm! I have a config.py file that contains database secrets. When I try to run a simple asset (
historical marketcap
) Im getting the following error
Copy code
dagster._core.errors.DagsterImportError: Encountered ImportError: `No module named 'config'` while importing module data. Local modules were resolved using the working directory `/opt/dagster/app`. If another working directory should be used, please explicitly specify the appropriate path using the `-d` or `--working-directory` for CLI based targets or the `working_directory` configuration option for workspace targets.
where's the best place to keep a config file to be shared across multiple jobs or assets?
should I just use a
.env file
?
s

Sean Davis

02/06/2023, 4:34 PM
What is the command line that you used to run dagster/dagit? It looks like you might need to specify a working directory.
k

Kevin Otte

02/06/2023, 4:35 PM
Right now, ive just been using the UI to do it. Im really just getting used to the workflow and getting a basic example working. Can you link documentation for. specifying the working directory?
or should I just include a resources.py file?
s

sean

02/08/2023, 12:22 PM
Hi Kevin, if you look at the error you can see that the working directory
/opt/dagster/app
is being used, but from your image,
config.py
is not in this directory-- it’s inside another python package (
assets
). It’s hard to say more without knowing more about your filesystem layout, but I’m guessing that
import assets.config
might resolve correctly.