Skip to content

[BUG] Error when "from promptflow._internal import PROMPTFLOW_CONNECTIONS, ConnectionManager, _change_working_dir "Β #3996

@jiazengcindy

Description

@jiazengcindy

Describe the bug

from promptflow._internal import PROMPTFLOW_CONNECTIONS
Traceback (most recent call last):
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/init.py", line 19, in
from promptflow._sdk._pf_client import PFClient as _PFClient
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/_pf_client.py", line 24, in
from .operations import RunOperations
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/operations/init.py", line 7, in
from ._flow_operations import FlowOperations
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/operations/_flow_operations.py", line 36, in
from promptflow._sdk._orchestrator import TestSubmitter
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/_orchestrator/init.py", line 5, in
from .test_submitter import TestSubmitter
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/_orchestrator/test_submitter.py", line 15, in
from promptflow._internal import ConnectionManager
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_internal/init.py", line 52, in
from promptflow._sdk._service.apis.collector import trace_collector
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/_service/apis/collector.py", line 17, in
from promptflow._sdk._tracing import _is_azure_ext_installed, process_otlp_trace_request
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/_tracing.py", line 61, in
from promptflow._sdk._utilities.tracing_utils import get_workspace_kind, parse_kv_from_pb_attribute, parse_protobuf_span
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/_utilities/tracing_utils.py", line 33, in
from promptflow._sdk._telemetry.telemetry import get_telemetry_logger
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/_telemetry/init.py", line 11, in
from .logging_handler import PromptFlowSDKLogHandler, get_appinsights_log_handler # noqa: F401
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/_sdk/_telemetry/logging_handler.py", line 10, in
from azure.monitor.opentelemetry.exporter import AzureMonitorLogExporter
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/azure/monitor/opentelemetry/init.py", line 7, in
from azure.monitor.opentelemetry._configure import configure_azure_monitor
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/azure/monitor/opentelemetry/_configure.py", line 12, in
from opentelemetry.instrumentation.dependencies import (
ImportError: cannot import name 'get_dist_dependency_conflicts' from 'opentelemetry.instrumentation.dependencies' (/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/opentelemetry/instrumentation/dependencies.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 1, in
File "/azureml-envs/prompt-flow/runtime/lib/python3.10/site-packages/promptflow/init.py", line 21, in
raise Exception(
Exception: Promptflow may not installed correctly. If you are upgrading from 'promptflow<1.8.0' to 'promptflow>=1.8.0', please run 'pip uninstall -y promptflow promptflow-core promptflow-devkit promptflow-azure', then 'pip install promptflow>=1.8.0'. Reach https://microsoft.github.io/promptflow/how-to-guides/faq.html#promptflow-1-8-0-upgrade-guide for more information.

This error occurs when the versions of the opentelemetry-related packages are as below:

opentelemetry-api 1.32.0
opentelemetry-exporter-otlp-proto-common 1.32.0
opentelemetry-exporter-otlp-proto-http 1.32.0
opentelemetry-instrumentation 0.53b0
opentelemetry-instrumentation-asgi 0.53b0
opentelemetry-instrumentation-dbapi 0.53b0
opentelemetry-instrumentation-django 0.53b0
opentelemetry-instrumentation-fastapi 0.53b0
opentelemetry-instrumentation-flask 0.53b0
opentelemetry-instrumentation-psycopg2 0.53b0
opentelemetry-instrumentation-requests 0.53b0
opentelemetry-instrumentation-urllib 0.53b0
opentelemetry-instrumentation-urllib3 0.53b0
opentelemetry-instrumentation-wsgi 0.53b0
opentelemetry-proto 1.32.0
opentelemetry-resource-detector-azure 0.1.5
opentelemetry-sdk 1.32.0
opentelemetry-semantic-conventions 0.53b0
opentelemetry-util-http 0.53b0

How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:

  1. pip install opentelemetry-api==1.32.0 opentelemetry-exporter-otlp-proto-common==1.32.0 opentelemetry-exporter-otlp-proto-http==1.32.0 opentelemetry-instrumentation==0.53b0 opentelemetry-instrumentation-asgi==0.53b0 opentelemetry-instrumentation-dbapi==0.53b0 opentelemetry-instrumentation-django==0.53b0 opentelemetry-instrumentation-fastapi==0.53b0 opentelemetry-instrumentation-flask==0.53b0 opentelemetry-instrumentation-psycopg2==0.53b0 opentelemetry-instrumentation-requests==0.53b0 opentelemetry-instrumentation-urllib==0.53b0 opentelemetry-instrumentation-urllib3==0.53b0 opentelemetry-instrumentation-wsgi==0.53b0 opentelemetry-proto==1.32.0 opentelemetry-resource-detector-azure==0.1.5 opentelemetry-sdk==1.32.0 opentelemetry-semantic-conventions==0.53b0 opentelemetry-util-http==0.53b0

  2. from promptflow._internal import PROMPTFLOW_CONNECTIONS, ConnectionManager, _change_working_dir

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

Image

Running Information(please complete the following information):

  • Promptflow Package Version using 1.17.2
  • Operating System: [e.g. Ubuntu 20.04, Windows 11]
  • Python Version using python --version: [e.g. python==3.10.12]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions