Skip to content

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

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

Closed
jiazengcindy opened this issue Apr 10, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@jiazengcindy
Copy link
Contributor

jiazengcindy commented Apr 10, 2025

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.

@jiazengcindy jiazengcindy added the bug Something isn't working label Apr 10, 2025
@wschultz-boxboat
Copy link

We're getting the same issue with promptflow version 1.17.2 when building for docker. Opentelemetry deployed a new version, 53b0, 8 hours ago, and it included renaming their function from get_dist_dependency_conflicts to get_dependency_conflicts

pf flow build -o dist -f docker --source .

@jiazengcindy
Copy link
Contributor Author

open-telemetry/opentelemetry-python-contrib#3418
Seems this is fixed.

@kenny-nguyen-at-neudesic
Copy link

kenny-nguyen-at-neudesic commented Apr 11, 2025

open-telemetry/opentelemetry-python-contrib#3418 Seems this is fixed.

The pull request in question was closed without merging, was it fixed via another method?

@jiazengcindy
Copy link
Contributor Author

They realized the issue. The error occurred inside opentelemetry-related packages. It was probably fixed elsewhere. The problem no longer exists in today’s build.

@Flowhill
Copy link

I still run into this issue even when setting

opentelemetry-instrumentation==0.53b1

On either promptflow==1.17.2 or promptflow==1.17.0.

How did you guys solve this?

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

4 participants