Error while trying to import BaseEventEmitter from pyee
Description
I tried to run an app based on slackeventsapi locally and got the below error:
ImportError: cannot import name 'BaseEventEmitter' from 'pyee' (/home/main-user/work/py-virtual-envs/venv-slackbot/lib64/python3.12/site-packages/pyee/__init__.py). Did you mean: 'EventEmitter'?
Above line indicates to the call here And when I checked in pyee documentation regarding BaseEventEmitter, it seems it has been deprecated as per this link
If I change the definition to below line in init.py to:
from pyee import EventEmitter as BaseEventEmitter
it works as expected.
What type of issue is this? (place an x in one of the [ ])
- [x] bug
- [ ] enhancement (feature request)
- [ ] question
- [ ] documentation related
- [ ] testing related
- [ ] discussion
Requirements
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
slackeventsapi version: 3.0.3 python version: 3.12 OS version(s): Fedora 40
Steps to reproduce:
Expected result:
What you expected to happen
No error
Actual result:
What actually happened
ImportError: cannot import name 'BaseEventEmitter' from 'pyee' (/home/main-user/work/py-virtual-envs/venv-slackbot/lib64/python3.12/site-packages/pyee/__init__.py). Did you mean: 'EventEmitter'?
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
Hi @pravarag, thanks for reporting this. Indeed, this library is not compatible with pyee's latest major version 12.x.
https://github.com/slackapi/python-slack-events-api/pull/108 , which is included in v3.0.3, narrowed the supported pyee versions, but when you install pyee's latest version anyway, your situation can arise. The immediate suggestion is to use pyee 11.x, but this project may support 12+ in the future.
With that being said, there is no merit in continuing to use this library for Slack's Events API handling (please read this important notice). Please consider using bolt-python with its Flask adapter: https://github.com/slackapi/bolt-python/tree/main/examples/flask