Hi, everyone. I am new to Dagster and I meet a str...
# announcements
q
Hi, everyone. I am new to Dagster and I meet a strange problem, when I run the python file using dagit, I find that the order of importing python library matters. And the detail is showed in https://github.com/dagster-io/dagster/issues/2767. Any help will be appreciated.
m
thanks @QianXiao! this is a confusing one
cc @alex-- i wonder if
sync_get_external_repositories
is not playing nicely with relative imports / pythonpath -- i also wonder if this is windows- or anaconda-only
@QianXiao it might be helpful to see the output of
conda list
d
I can repro this on my mac with the same two files
m
that's great
q
@max the output of
conda list
is a very long
d
Similar issue happening on that file in master right now, just at a slightly different place (and maybe a bit more info on py38 about why the import is failing?): https://dagster.phacility.com/P69
m
Copy code
from . import numeric\n  File "/Users/dgibson/.pyenv/versions/3.8.1/envs/dagster-3.8.1/lib/python3.8/site-packages/numpy/core/numeric.py", line 23, in <module>\n    from . import shape_base\n  File "/Users/dgibson/.pyenv/versions/3.8.1/envs/dagster-3.8.1/lib/python3.8/site-packages/numpy/core/shape_base.py", line 9, in <module>\n    from . import numeric as _nx\nImportError: cannot import name \'numeric\' from partially initialized module \'numpy.core\' (most likely due to a circular import)
wild, that looks like a circular import in numpy but it can't be
q
and the error occured, if we
import numpy as np
in the message.py
a
what happens if you run
dagit -f simple_task.py -d .
?
q
@alex get the same error
a
So we recently introduced this
working_directory
/
-d
aspect to file based loads to ensure we capture if the current working directory needs to be set, in your case
from message import Message
only works if the working directory is the one containing the two files. Though its only supposed to warn if its not set, and you are still getting the error with
-d
so…. very puzzling
q
yep, the working directory is the one containing the two files,
and run the command in the directory
@alex I don't know whether is helpful, but I
import pandas as pd
also encounters the error
m
i think we are close to a fix
q
a
are you saying that if you move
pandas
above the
message
import it works as well?
q
yep, that works as well
and some libs that python built-in, do not have the problem
a
message.py is just those 5 lines?
q
right, just 5 lines
a
great thanks for the report, pretty sure we found the issue and a fix should go out in 0.8.10 later today
s
hey @QianXiao we just pushed a release with the fix for this - let us know if you’re still running into issues
q
@sashank You guys are awesome, I test the latest version and it works. Thanks everyone for your help @max @alex @daniel
🙌 1
d
No problem, this was actually the root cause of another mysterious bug and your report helped us get to the bottom of it, so thank you!