Skip to content
mrb-github edited this page Apr 28, 2020 · 1 revision

Problem: ModuleNotFoundError: No module named 'kafka' solution:

  • edit venv/pyvenv.cfg
  • edit the line -> include-system-site-packages = false
  • change it to true

Details: I am trying to use flask and kafka in a project. My python kafka sender worked fine however as soon as I started the work to integrate the two. The first line of import below

from kafka import KafkaProducer

produced the error: "ModuleNotFoundError: No module named 'kafka'"

When running the pure kafka sender, I was not booting the venv/bin/activate file. However, when I started to work on the flask, I was booting that file. After googling around and reading the virtual environment details, figured the above setting might work, and it DID!

Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy