python module not found

See original GitHub issue

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”

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ocelotlcommented, Jun 21, 2022

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
0reactions
iomaricommented, Jun 23, 2022

Problem solved. Did a pip cache purge, reinstalled all modules and all is working. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - Module Not Found - Stack Overflow
You need to make sure the module is installed for all versions of python · Change the import line in hello-world.py to from...
Read more >
ModuleNotFoundError: no module named Python Error [Fixed]
How to fix the ModuleNotFoundError in Python · 1. Make sure imported modules are installed · 2. Make sure modules are spelled correctly...
Read more >
ModuleNotFoundError: No module named x
If the name couldn't be found in sys.modules then Python is going to search for it in Python Standard Library. Again, if the...
Read more >
Why Can't Python Find My Modules? - Real Python
This is caused by the fact that the version of Python you're running your script with is not configured to search for modules...
Read more >
Python Import Error (ModuleNotFoundError) - Finxter
Python's ImportError ( ModuleNotFoundError ) indicates that you tried to import a module that Python doesn't find. It can usually be eliminated by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found