Create a virtualenv with the ELPY dependencies
mkvirtualenv -p python3 kafka
workon kafka
pip install flask kafka opencv-python
For an ELPY Emacs init.el see
Start Emacs
M-x elpy-config
Read the instructions in the ELPY config window about which Python packages to install using your virtualenv.
Install the Jedi server
M-x jedi:install-server