Skip to content

No module named 'weaviate.classes' #26925

Closed

Description

@showfuture

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

Image

❌ Actual Behavior

When I added documents to the knowledge base and tried to reference the knowledge base during a chat to answer questions, I found that the knowledge base wasn’t being used. Then, when I ran a data recall test in the knowledge base, I encountered the error shown above. I deployed Dify using the Docker method described in the documentation, and all containers are running normally.

Activity

  1. added
    👻 feat:rag
    on Oct 15, 2025
  2. dosubot commented on Oct 15, 2025

    @dosubot

    Hi @showfuture! I'm Dosu and I’m helping the dify team.

    The error No module named 'weaviate.classes' means your Docker environment is missing the required Weaviate Python client (version 4.x), which is needed for Dify's knowledge base features to work. Recent updates to Dify's Docker setup explicitly install weaviate>=4.0.0 in the API container to fix this issue. To resolve it, update your deployment so the API container runs pip install --no-cache-dir 'weaviate>=4.0.0' before starting the service. You can see how this is done in the new docker-compose.override.yml added to the project, which mounts the Weaviate integration file and installs the correct package at startup (details).

    If you are using an older Docker image or compose file, manually add this install step to your API container or update to the latest compose setup. This will restore knowledge base recall and chat integration with Weaviate.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

  3. protectedMan commented on Oct 15, 2025

    @protectedMan

    I have upgraded to the latest versions, specifically weaviate==0.1.2 and weaviate-client==3.8.0, but I'm still encountering the error "No module named 'weaviate.classes'."

    Hi @showfuture! I'm Dosu and I’m helping the dify team.

    The error No module named 'weaviate.classes' means your Docker environment is missing the required Weaviate Python client (version 4.x), which is needed for Dify's knowledge base features to work. Recent updates to Dify's Docker setup explicitly install weaviate>=4.0.0 in the API container to fix this issue. To resolve it, update your deployment so the API container runs pip install --no-cache-dir 'weaviate>=4.0.0' before starting the service. You can see how this is done in the new docker-compose.override.yml added to the project, which mounts the Weaviate integration file and installs the correct package at startup (details).

    If you are using an older Docker image or compose file, manually add this install step to your API container or update to the latest compose setup. This will restore knowledge base recall and chat integration with Weaviate.

    To reply, just mention @dosu.

    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

  4. showfuture commented on Oct 15, 2025

    @showfuture
    Author

    @dosu Hello, thank you for your help. I followed your instructions and restarted the containers using docker-compose, but the other error occurred, as shown below.

    Additionally, if there are fixes for certain bugs, could they be applied directly to the docker-compose.yml file instead of docker-compose.override.yml? After all, the documentation’s Docker startup instructions only mention running docker compose up, and do not refer to docker-compose.override.yml.

    Image Image Image

    Hi @showfuture! I'm Dosu and I’m helping the dify team.

    The error No module named 'weaviate.classes' means your Docker environment is missing the required Weaviate Python client (version 4.x), which is needed for Dify's knowledge base features to work. Recent updates to Dify's Docker setup explicitly install weaviate>=4.0.0 in the API container to fix this issue. To resolve it, update your deployment so the API container runs pip install --no-cache-dir 'weaviate>=4.0.0' before starting the service. You can see how this is done in the new docker-compose.override.yml added to the project, which mounts the Weaviate integration file and installs the correct package at startup (details).

    If you are using an older Docker image or compose file, manually add this install step to your API container or update to the latest compose setup. This will restore knowledge base recall and chat integration with Weaviate.

  5. dosubot commented on Oct 15, 2025

    @dosubot

    The HTTP 422 error about "no GraphQL provider or schema" means your Weaviate instance is running without the required schema for Dify's knowledge base integration. Dify expects to programmatically initialize the schema when it connects to Weaviate, but if the Weaviate server was upgraded, reset, or started fresh, you may need to reinitialize the knowledge base or reimport documents so Dify can create the schema via its backend code. Try deleting and recreating the knowledge base or re-uploading your documents in the Dify UI to trigger schema setup.

    For Docker Compose: you can apply fixes (like installing Python packages) directly in docker-compose.yml or in docker-compose.override.yml. Both files are picked up automatically when you run docker compose up—the override file is just a convention for customizations or local changes, but direct edits to docker-compose.yml work as well. The recent Dify updates use docker-compose.override.yml to install the correct Weaviate client, but you can move those install steps to docker-compose.yml if you prefer a single file setup details.

    If you continue to see schema errors after confirming the client version and restarting, check that your Weaviate container is healthy and that the knowledge base is initialized with at least one document. If the schema is still missing, you may need to manually trigger a reimport or initialization from the Dify UI.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

  6. showfuture commented on Oct 15, 2025

    @showfuture
    Author

    @dosu._
    Thank you! After I deleted the existing document records and re-uploaded the knowledge base documents, both the knowledge base data recall and the LLM knowledge base referencing started working properly!

  7. ViPenn commented on Oct 15, 2025

    @ViPenn

    @showfuture
    Hello, I'm sorry to disturb you. I also encountered the same problem. However, even after modifying the YAML and redeploying, the error "No module named 'weaviate.classes'" still occurred. Below is my YAML file. Could you please take a look at it for me?
    Image

  8. showfuture commented on Oct 15, 2025

    @showfuture
    Author

    @showfuture Hello, I'm sorry to disturb you. I also encountered the same problem. However, even after modifying the YAML and redeploying, the error "No module named 'weaviate.classes'" still occurred. Below is my YAML file. Could you please take a look at it for me? Image

    git checkout 1.9.1 and try again.

  9. ViPenn commented on Oct 15, 2025

    @ViPenn

    @showfuture Hello, I'm sorry to disturb you. I also encountered the same problem. However, even after modifying the YAML and redeploying, the error "No module named 'weaviate.classes'" still occurred. Below is my YAML file. Could you please take a look at it for me? Image

    git checkout 1.9.1 and try again.

    Thank you very much for your help. It's all set now.

  10. pigracing commented on Oct 17, 2025

    @pigracing

    @showfuture Hello, I'm sorry to disturb you. I also encountered the same problem. However, even after modifying the YAML and redeploying, the error "No module named 'weaviate.classes'" still occurred. Below is my YAML file. Could you please take a look at it for me? Image

    git checkout 1.9.1 and try again.

    not work in 1.9.1

  11. ViPenn commented on Oct 17, 2025

    @ViPenn

    @showfuture Hello, I'm sorry to disturb you. I also encountered the same problem. However, even after modifying the YAML and redeploying, the error "No module named 'weaviate.classes'" still occurred. Below is my YAML file. Could you please take a look at it for me? Image

    git checkout 1.9.1 and try again.

    not work in 1.9.1

    Please first execute the "git fetch" command

  12. pigracing commented on Oct 17, 2025

    @pigracing

    @showfuture Hello, I'm sorry to disturb you. I also encountered the same problem. However, even after modifying the YAML and redeploying, the error "No module named 'weaviate.classes'" still occurred. Below is my YAML file. Could you please take a look at it for me? Image

    git checkout 1.9.1 and try again.

    not work in 1.9.1

    Please first execute the "git fetch" command

    i use docker compose to deploy it

  13. ViPenn commented on Oct 17, 2025

    @ViPenn

    @showfuture Hello, I'm sorry to disturb you. I also encountered the same problem. However, even after modifying the YAML and redeploying, the error "No module named 'weaviate.classes'" still occurred. Below is my YAML file. Could you please take a look at it for me? Image

    git checkout 1.9.1 and try again.

    not work in 1.9.1

    Please first execute the "git fetch" command

    i use docker compose to deploy it

    Yes, I also used Docker Compose for the deployment. You need to first use the git command to obtain the code of the specified branch, and then redeploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    👻 feat:rag

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions