Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Unable to determine source root #2584

Closed
1 task done
songbotao opened this issue Apr 4, 2024 · 4 comments
Closed
1 task done

[BUG]: Unable to determine source root #2584

songbotao opened this issue Apr 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@songbotao
Copy link

Contact Details [Optional]

No response

System Information

│ 227 │ │ ) │
│ 228 │ │
│ 229 │ if not hasattr(main_module, "file") or not main_module._file
│ ❱ 230 │ │ raise RuntimeError( │
│ 231 │ │ │ "Unable to determine source root because the main module d │
│ 232 │ │ │ "have an associated file. This could be because you're run │
│ 233 │ │ │ "an interactive Python environment."

What happened?

my code:

import os
import sys
from datetime import datetime as dt

from dask.distributed import LocalCluster, Client as DaskClient

from zenml.logger import get_logger
from zenml.client import Client
from zenml.integrations.mlflow.experiment_trackers import MLFlowExperimentTracker

experiment_tracker = Client().active_stack.experiment_tracker

from dask.distributed import LocalCluster, Client as DaskClient

def init_local_cluster(n_workers=6):
"""

"""
dask_cluster = LocalCluster(n_workers=n_workers, threads_per_worker=1)

dask_client = DaskClient(dask_cluster)

return dask_client, dask_cluster

if name == 'main':
"""
This is a runner for the pipline of nsi_evaluation.

"""


# 开启dask集群
client, cluster = init_local_cluster(6)

# 关闭
client.close()

Reproduction steps

...

Relevant log output

│   227 │   │   )                                                              │
│   228 │                                                                      │
│   229 │   if not hasattr(main_module, "__file__") or not main_module.__file_ │
│ ❱ 230 │   │   raise RuntimeError(                                            │
│   231 │   │   │   "Unable to determine source root because the main module d │
│   232 │   │   │   "have an associated file. This could be because you're run │
│   233 │   │   │   "an interactive Python environment."

Code of Conduct

  • I agree to follow this project's Code of Conduct
@songbotao songbotao added the bug Something isn't working label Apr 4, 2024
@htahir1
Copy link
Contributor

htahir1 commented Apr 4, 2024

@songbotao I think this happens if you dont do zenml init at the root of your repo?

@songbotao
Copy link
Author

@songbotao I think this happens if you dont do zenml init at the root of your repo?

I have already executed 'zenml init', and running ZenML pipeline computations is working fine.

@strickvl
Copy link
Contributor

strickvl commented Apr 8, 2024

@songbotao so everything's working fine? or is there something else you're reporting in this issue?

@strickvl
Copy link
Contributor

strickvl commented May 3, 2024

Closing this as it seems like the issue is resolved. Please feel free to comment here or reopen if not.

@strickvl strickvl closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants