No module named 'elasticapm.contrib.aiohttp'
See original GitHub issueWhen I install the package using pip install elastic-apm
, the aiohttp
module is not found in the library. I tried installing via cloning the repository and using pip install .
on the project’s root directory and the aiohttp
module was there. My best guess is that the PyPi of the project is not up-to-date. But then again I may be wrong and I may have to do something that I’m not aware of. By the way I read the docs as well but no luck there too.
To Reproduce
- install the package using
pip install elastic-apm
- try importing like this
from elasticapm.contrib.aiohttp import ElasticAPM
- you would encounter something like this:
No module named 'elasticapm.contrib.aiohttp'
- try cloning the repository and installing via
pip install .
in the project’s root directory and thenfrom elasticapm.contrib.aiohttp import ElasticAPM
would work just find.
Expected behavior: …
I was expecting that it would work just find using the simple installation of pip install elastic-apm
Environment (please complete the following information)
- OS: Linux
- Python version: 3.8.1
- Framework and version [e.g. Django 2.1]: Aiohttp 3.6.2
- APM Server version: 5.3.3
- Agent version: doesn’t matter but 7.5.0
Additional context
setup.py
:
from setuptools import setup, find_packages
...
REQUIRES = [
...
'elastic-apm==5.3.3',
...
]
...
setup(
...
install_requires=REQUIRES,
python_requires='>=3.8.1',
...
)
- elasticapm library
/app # tail -2 /usr/local/lib/python3.8/site-packages/elasticapm/version.py
__version__ = (5, 3, 3)
VERSION = ".".join(map(str, __version__))
/app # ls -l /usr/local/lib/python3.8/site-packages/elasticapm/contrib/
total 52
-rw-r--r-- 1 root root 1591 Feb 1 07:54 __init__.py
drwxr-xr-x 2 root root 4096 Feb 1 07:54 __pycache__
-rw-r--r-- 1 root root 5982 Feb 1 07:54 async_worker.py
drwxr-xr-x 3 root root 4096 Feb 1 07:54 celery
drwxr-xr-x 6 root root 4096 Feb 1 07:54 django
drwxr-xr-x 3 root root 4096 Feb 1 07:54 flask
drwxr-xr-x 3 root root 4096 Feb 1 07:54 opentracing
-rw-r--r-- 1 root root 1788 Feb 1 07:54 paste.py
drwxr-xr-x 3 root root 4096 Feb 1 07:54 pylons
drwxr-xr-x 3 root root 4096 Feb 1 07:54 rq
drwxr-xr-x 3 root root 4096 Feb 1 07:54 twisted
drwxr-xr-x 3 root root 4096 Feb 1 07:54 zerorpc
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
ModuleNotFoundError: No module named 'elastic-apm'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'elastic-apm' How to remove the Module.
Read more >Elastic Apm python agent connection problem - Stack Overflow
On my APM server, I'm not receiving any requests from my agent. I checked the APM server log files. django · elasticsearch ·...
Read more >Starlette/FastAPI Support | APM Python Agent ... - Elastic
Incorporating Elastic APM into your Starlette project only requires a few easy steps. Installationedit. Install the Elastic APM agent using pip: $ pip...
Read more >ModuleNotFoundError: No module named 'aiohttp' in Python
The Python ModuleNotFoundError: No module named 'aiohttp' occurs when we forget to install the `aiohttp` module before importing it or install it in...
Read more >Python Examples of aiohttp.web.HTTPException
HTTPUnauthorized(reason="That snowflake is not valid!") formdata = await request.post() async with self.pool.acquire() as connection: name = await connection.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @meysam81
support for aiohttp hasn’t been quite released yet. You can try it out by installing the agent from the master branch
I would love to hear your feedback how it works for you!
Can you try this instead, then?
It’ll still say the version is 5.3.3, as that’s what current master is set to:
https://github.com/elastic/apm-agent-python/blob/f007f22b44d051d197aa7b54de8fc9e6deec3e4b/elasticapm/version.py#L31-L32
We probably should consider adding a
post1
component to the version on master to make things like this clearer.