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

Confluence loader do not find atlassian package #4309

Closed
rossm-mf opened this issue Oct 28, 2024 · 7 comments · Fixed by #4430
Closed

Confluence loader do not find atlassian package #4309

rossm-mf opened this issue Oct 28, 2024 · 7 comments · Fixed by #4430
Assignees
Labels
bug Something isn't working

Comments

@rossm-mf
Copy link

Bug Description

Trying to run the Confluence Loader I get this error

Error building Component Confluence: atlassian package not found, please run pip install atlassian-python-api


`atlassian` package not found, please run `pip install atlassian-python-api`

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/langchain_community/document_loaders/confluence.py", line 203, in __init__
    from atlassian import Confluence
ModuleNotFoundError: No module named 'atlassian'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/langflow/graph/vertex/base.py", line 727, in _build_results
    result = await initialize.loading.get_instance_results(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/langflow/interface/initialize/loading.py", line 67, in get_instance_results
    return await build_component(params=custom_params, custom_component=custom_component)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/langflow/interface/initialize/loading.py", line 153, in build_component
    build_results, artifacts = await custom_component.build_results()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/langflow/custom/custom_component/component.py", line 707, in build_results
    return await self._build_with_tracing()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/langflow/custom/custom_component/component.py", line 695, in _build_with_tracing
    _results, _artifacts = await self._build_results()
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/langflow/custom/custom_component/component.py", line 731, in _build_results
    result = method()
             ^^^^^^^^
  File "<string>", line 80, in load_documents
  File "<string>", line 69, in build_confluence
  File "/app/.venv/lib/python3.12/site-packages/langchain_community/document_loaders/confluence.py", line 205, in __init__
    raise ImportError(
ImportError: `atlassian` package not found, please run `pip install atlassian-python-api`

Even used
image

and I get this

Successfully installed atlassian-python-api
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: atlassian-python-api in ./data/.local/lib/python3.12/site-packages (3.41.16)
Requirement already satisfied: deprecated in ./data/.local/lib/python3.12/site-packages (from atlassian-python-api) (1.2.14)
Requirement already satisfied: requests in ./data/.local/lib/python3.12/site-packages (from atlassian-python-api) (2.32.3)
Requirement already satisfied: six in ./data/.local/lib/python3.12/site-packages (from atlassian-python-api) (1.16.0)
Requirement already satisfied: oauthlib in ./data/.local/lib/python3.12/site-packages (from atlassian-python-api) (3.2.2)
Requirement already satisfied: requests-oauthlib in ./data/.local/lib/python3.12/site-packages (from atlassian-python-api) (2.0.0)
Requirement already satisfied: jmespath in ./data/.local/lib/python3.12/site-packages (from atlassian-python-api) (1.0.1)
Requirement already satisfied: beautifulsoup4 in ./data/.local/lib/python3.12/site-packages (from atlassian-python-api) (4.12.3)
Requirement already satisfied: soupsieve>1.2 in ./data/.local/lib/python3.12/site-packages (from beautifulsoup4->atlassian-python-api) (2.6)
Requirement already satisfied: wrapt<2,>=1.10 in ./data/.local/lib/python3.12/site-packages (from deprecated->atlassian-python-api) (1.16.0)
Requirement already satisfied: charset-normalizer<4,>=2 in ./data/.local/lib/python3.12/site-packages (from requests->atlassian-python-api) (3.4.0)
Requirement already satisfied: idna<4,>=2.5 in ./data/.local/lib/python3.12/site-packages (from requests->atlassian-python-api) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./data/.local/lib/python3.12/site-packages (from requests->atlassian-python-api) (2.2.3)
Requirement already satisfied: certifi>=2017.4.17 in ./data/.local/lib/python3.12/site-packages (from requests->atlassian-python-api) (2024.8.30)

Reproduction

Used the followind docker-compose

  langflow:
    image: langflowai/langflow:latest
    container_name: langflow
    restart: always
    ports:
      - 7860:7860
    volumes:
      - langflow-data:/app/langflow/

Tried to connect to the container and install it but it does seems to make a differents

tried pip install -U atlassian-python-api
tried pip install atlassian-python-api

tried source .venv/bin/activate then pi install

When I do pip list I see in the list

Expected behavior

based on this doc it seems to be included https://docs.langflow.org/components-loaders

So I expected the loader to work on the first try. Not sure how I am support to do it

Who can help?

No response

Operating System

Docker container

Langflow Version

1.0.19.post2

Python Version

None

Screenshot

No response

Flow File

No response

@rossm-mf rossm-mf added the bug Something isn't working label Oct 28, 2024
Copy link

dosubot bot commented Oct 28, 2024

Hello @rossm-mf! I'm here to help you with any bugs, questions, or contributions. Let's get started!

The issue you're encountering is likely due to the atlassian-python-api package not being installed in the correct environment within the Docker container. Here are some steps you can take to resolve this:

  1. Modify the Dockerfile: You need to ensure that the atlassian-python-api package is installed in the virtual environment used by Langflow. You can do this by modifying the Dockerfile to include the package installation. Add the following line to the Dockerfile after the existing RUN commands:

    RUN $POETRY_HOME/bin/poetry run pip install atlassian-python-api
  2. Rebuild the Docker Image: After modifying the Dockerfile, rebuild the Docker image to apply the changes. You can do this by running:

    docker-compose build
  3. Restart the Docker Container: Once the image is rebuilt, restart the Docker container to ensure the changes take effect:

    docker-compose up -d

These steps should ensure that the atlassian-python-api package is installed in the correct environment, allowing the ConfluenceLoader to function properly. If you continue to experience issues, double-check that the Dockerfile modifications are correctly applied and that the container is using the updated image.

To continue talking to Dosu, mention @dosu.

@rossm-mf
Copy link
Author

@dosu : is there a way to do it without rebuilding the image?

Copy link

dosubot bot commented Oct 28, 2024

You can try installing the package directly inside the running Docker container without rebuilding the image. Here’s how you can do it:

  1. Access the Running Container: Use the following command to get a shell inside the running container:

    docker exec -it langflow /bin/bash
  2. Activate the Virtual Environment: Once inside the container, activate the virtual environment used by Langflow:

    source /app/.venv/bin/activate
  3. Install the Package: Install the atlassian-python-api package within the activated virtual environment:

    pip install atlassian-python-api
  4. Exit the Container: After installation, exit the container:

    exit
  5. Restart the Container: Restart the container to ensure the changes take effect:

    docker restart langflow

This approach should allow you to install the package without needing to rebuild the Docker image. If you encounter any issues, ensure that the package is installed in the correct virtual environment.

To continue talking to Dosu, mention @dosu.

@rossm-mf
Copy link
Author

You can try installing the package directly inside the running Docker container without rebuilding the image. Here’s how you can do it:

  1. Access the Running Container: Use the following command to get a shell inside the running container:
    docker exec -it langflow /bin/bash
  2. Activate the Virtual Environment: Once inside the container, activate the virtual environment used by Langflow:
    source /app/.venv/bin/activate
  3. Install the Package: Install the atlassian-python-api package within the activated virtual environment:
    pip install atlassian-python-api
  4. Exit the Container: After installation, exit the container:
    exit
  5. Restart the Container: Restart the container to ensure the changes take effect:
    docker restart langflow

This approach should allow you to install the package without needing to rebuild the Docker image. If you encounter any issues, ensure that the package is installed in the correct virtual environment.

To continue talking to Dosu, mention @dosu.

definitly tried that so the problem must be somewhere else

@joaoguilhermeS
Copy link
Collaborator

Hey @rossm-mf there is been a while since Langflow is using uv to admin the dependencies on its code and docker images. So in this case, to install the package atlassian-python-api, you need to do something like this inside your container deployment:

pip install uv
~/.local/bin/uv pip install atlassian-python-api

@rossm-mf
Copy link
Author

rossm-mf commented Nov 5, 2024 via email

@edwinjosechittilappilly
Copy link
Collaborator

We are adding it to the requirements and it will be reflected in the upcoming upgrades/ releases of Datastax Langflow.
Thank you for your Feedback.

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

Successfully merging a pull request may close this issue.

3 participants