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

[⛔️ Error] ModuleNotFoundError: No module named 'models' #1034

Open
piyushgarg-dev opened this issue Nov 16, 2024 · 1 comment
Open

[⛔️ Error] ModuleNotFoundError: No module named 'models' #1034

piyushgarg-dev opened this issue Nov 16, 2024 · 1 comment

Comments

@piyushgarg-dev
Copy link

Hi Team, I am facing the issue ModuleNotFoundError: No module named 'models' inside executor functions and not able to debug it.

I have included all the necessary information about the code below.

Deployment of Graph

# File Path: vectorflow/graphs/graph.py

import models # top level import

g = RemoteGraphs.build_graph(graph, config)
      RemoteGraph.deploy(g, server_url=config.server_url, additional_modules=[
            models,
      ])

My Router

# File Path: vectorflow/routers/file_serializer_router

from indexify import IndexifyFunction
from models import FileConfig

# P.S. This is going to be a router but just for debugging made this `IndexifyFunction`.
class FileSerializerRouter(IndexifyFunction):
    name = "file_serializer_router"
    description = "Test Desc"

    def __init__(self) -> None:
        super().__init__()

    def run(self, file_config: FileConfig) -> str:
        print(f"file_config:{file_config}")
        return "None"
      # Execute Remote Graph
                graph = RemoteGraphs.get(
                    graph=RemoteGraphEnum.VECTORFLOW_GRAPH
)

                invocation_id = graph.run(
                    block_until_done=True,
                    file_config=file_config,

                )
                print(f"invocation_id:{invocation_id}")

File Structure

📦vectorflow
 ┣ 📂config
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜indexify.py
 ┣ 📂executors
 ┣ 📂graphs
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜graph.py
 ┣ 📂indexify_local_runner_cache
 ┣ 📂injectors
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜aws_sqs.py
 ┣ 📂models
 ┃ ┣ 📜__init__.py
 ┃ ┣ 📜file_config.py
 ┃ ┗ 📜injector_config.py
 ┣ 📂routers
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜file_serializer_router.py
 ┣ 📂utils
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜hash.py
 ┣ 📜main.py

Thanks in advance 😄

@piyushgarg-dev
Copy link
Author

piyushgarg-dev commented Nov 16, 2024

As per our conversation on discord, Please find the updated file tree of my project. The issue still persists.

Screenshot 2024-11-16 at 1 53 53 PM
📦vectorflow
 ┣ 📂__pycache__
 ┃ ┗ 📜models.cpython-311.pyc
 ┣ 📂config
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜indexify.py
 ┣ 📂executors
 ┣ 📂graphs
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜graph.py
 ┣ 📂indexify_local_runner_cache
 ┣ 📂injectors
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜aws_sqs.py
 ┣ 📂routers
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜file_serializer_router.py
 ┣ 📂utils
 ┃ ┣ 📜__init__.py
 ┃ ┗ 📜hash.py
 ┣ 📜__init__.py
 ┣ 📜main.py
 ┗ 📜models.py <------------- Moved Here

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant