opentelemetry-python: python module not found

HP ENVY 17" i7 laptop: Kubuntu 21.10

Steps to reproduce Greetings, I’m relatively new to Opentelemetry. I’ve followed many tutorials including opentelemetry.io but I keep running into dependency problems with the python stack.

What is the expected behavior? I don’t expect any error

What is the actual behavior? "No module named 'opentelemetry.exporter.otlp.proto.grpc.metric_exporter'".

Additional context

I have all the python modules loaded after running "opentelemetry-bootstrap --action=install" but still that module is not found. I’m not new to python and I’ve traced into the code and can not find why that module is not found even though I see it at: “opentelemetry/opentelemetry-python-1.12.0rc1/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc”

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (6 by maintainers)

Most upvoted comments

I set up a new environment and installed: opentelemetry-api opentelemetry-sdk opentelemetry-proto opentelemetry-exporter-otlp opentelemetry-distro

and when I run the example that you pointed me to, I get the following error:

─ python ./metrics02.py                                                                                     ─╯
Traceback (most recent call last):
  File "/home/iomari/temp/opentelemetry/newsample/./metrics02.py", line 3, in <module>
    from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import (
ModuleNotFoundError: No module named 'opentelemetry.exporter.otlp.proto.grpc.metric_exporter'

I can reproduce by creating a new virtual environment and installing the listed components above with pip. The issue here happens because the latest release of opentelemetry-exporter-otlp (1.12.0rc1) is not installed by pip (because it is a pre-release).

I can confirm the example works with this virtual environment:

backoff==1.11.1
certifi==2022.6.15
charset-normalizer==2.0.12
Deprecated==1.2.13
googleapis-common-protos==1.56.2
grpcio==1.46.3
idna==3.3
opentelemetry-api==1.12.0rc1
opentelemetry-distro==0.31b0
opentelemetry-exporter-otlp==1.12.0rc1
opentelemetry-exporter-otlp-proto-grpc==1.12.0rc1
opentelemetry-exporter-otlp-proto-http==1.12.0rc1
opentelemetry-instrumentation==0.31b0
opentelemetry-proto==1.12.0rc1
opentelemetry-sdk==1.12.0rc1
opentelemetry-semantic-conventions==0.31b0
protobuf==3.20.1
requests==2.28.0
six==1.16.0
typing_extensions==4.2.0
urllib3==1.26.9
wrapt==1.14.1