Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

kafka import error

mrb-github edited this pageApr 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 finehowever 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


[8]ページ先頭

©2009-2025 Movatter.jp