stocky-city-94927
09/29/2023, 2:46 AMvictorious-lawyer-58417
09/29/2023, 5:07 AMvictorious-lawyer-58417
09/29/2023, 5:08 AMhello.py
from metaflow import FlowSpec, step
class HelloFlow(FlowSpec):
@step
def start(self):
print("Hello world!")
self.next(self.end)
@step
def end(self):
pass
if __name__ == "__main__":
HelloFlow()
and try to run it with python hello.py run do you see any errors?flat-hospital-6180
09/29/2023, 8:44 AM@kubernetes decorator in use because of mention of the error around it by @stocky-city-94927?
@stocky-city-94927 perhaps (and this may go as a guideline for reporting such issues, a "pinned" message 🙂 ), if you could share:
what steps you ran to install metaflow
pip install metaflow .. metaflow[batch] ... metaflow[kubernetes]
what example were you running actually
python <my-example-dag>.py run
the error trace you confronted?
(traceback) ...
from ... ln 150
/home/aks/.....py ln 450
Ykwim!...
btw @victorious-lawyer-58417 I tried to replicate the issue- I am installing metaflow from the master branch- and it takes me to version 2.9.14 in my venv.
and, when I pull tutorials : metaflor tutorials pull
and grep for usage of "@kuberntes",
I see:
as the usage, but it just doesnt exist/not importable. it rather exists as:Copy codefrom metaflow import FlowSpec, step, kubernetes, retry
metaflor.plugins.kubernetes, yet giving errors..
Traceback (most recent call last):
File "/home/sumit/.local/share/JetBrains/Toolbox/apps/pycharm-community-2/plugins/python-ce/helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/sumit/.local/share/JetBrains/Toolbox/apps/pycharm-community-2/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/sumit/Documents/repos/apache/metaflow/examples/metaflow_flow_debuggings/k8s_decorator_error.py", line 5, in <module>
class HelloFlow(FlowSpec):
File "/home/sumit/Documents/repos/apache/metaflow/examples/metaflow_flow_debuggings/k8s_decorator_error.py", line 7, in HelloFlow
@kubernetes()
TypeError: 'module' object is not callable
python-BaseException
because it is just not what it is expected to be! i.e a decorator func accepting args like : cpu, memory ... etc.stocky-city-94927
09/29/2023, 3:40 PMpip install virtualenv
virtualenv myenv
Then in the virtual environment, I typed these commands in the terminal:
pip install metaflow
pip install metaflow[batch] pip install metaflow[kubernetes]
AFter installation, here are some warning messages like this for both batch and kuvernetes. Could this be why?
requirement already satisfied: metaflow[batch] in d:\python\anaconda3\lib\site-packages (2.9.13) WARNING: metaflow 2.9.13 does not provide the extra 'batch'flat-hospital-6180
09/29/2023, 3:44 PMstocky-city-94927
09/29/2023, 3:52 PMflat-hospital-6180
09/29/2023, 4:11 PMfcntl is not available in there: see this https://stackoverflow.com/a/45228507
not sure if metaflow is getting along with Windows, I have linux. someone from the core team may be of help ... (sorry I am a newbie too, just somewhat keen! )stocky-city-94927
09/29/2023, 4:18 PM