skip to Main Content

After upgrading Python to 3.11, Locust-plugin fails to install as one of its dependency throws error

  1. First it asked me to install VC++ > 14.0
  2. After installing VC++ build tools 15, still it throws a different error

Note: We do not see this issue until Python 3.10.8

Kindly let me know if there is any fix?

locust-plugins==2.7.1
  - confluent-kafka [required: Any]
DEPRECATION: confluent-kafka is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 2
3.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for confluent-kafka ... error
  error: subprocess-exited-with-error

  × Running setup.py install for confluent-kafka did not run successfully.
  │ exit code: 1
  ╰─> [57 lines of output]
      running install
      C:~AppDataLocalProgramsPythonPython311Libsite-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use bu
ild and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      .............build~AppDataLocalTemppip-install-751nsegaconfluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55bsrc
      creating buildtemp.win-amd64-cpython-311Release~AppDataLocalTemppip-install-751nsegaconfluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55bsrcconfluent_kafka     
      creating build~AppDataLocalTemppip-install-751nsegaconfluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55bsrcconfluent_kafkasrc
      "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023binHostX86x64cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:~AppData
LocalProgramsPythonPython311include -IC:~AppDataLocalProgramsPythonPython311Include "-IC:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsM
SVC14.16.27023include" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0ucrt" "-IC:Program Files (x86)
Windows Kits10include10.0.19041.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0um" "-IC:Program Files (x86)Windows Kits10inIC:~AppDataLocalProgramsPythonPython311include -IC:~AppDataLocalProgramsPythonPython311Include "-IC:Program Files 
(x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.16.27023include" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0um" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0cppwinrt" /TcC:~AppDataLocalTemppip-install-751nsegaconfluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55bsrcconfluent_kafkasrcAdmin.c /Fobuild~AppDataLocalTemppip-install-751nsegaconfluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55bsrcconfluent_kafkasrcAdmin.obj
      Admin.c      c:~appdatalocaltemppip-install-751nsegaconfluent-kafka_3aae65aeec6a4e2ab93d05a4141fc55bsrcconfluent_kafkasrcconfluent_kafka.h(23): fatal error C1083: Cannot open include file: 'librdkafka/rdkafka.h': No such file or directory
      error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> confluent-kafka

2

Answers


  1. Right now there is currently no pre-built version of confluent-kafka for 3.11. Hopefully it is on the way though: https://github.com/confluentinc/confluent-kafka-python/issues/1452

    Also, I think the reason cannot build from source is that you need librdkafka installed. I dont know what the windows equivalent is, but apparently someone got it working on Linux this way:

    apt-get install -y --no-install-recommends gcc git libssl-dev g++ make && cd /tmp && git clone https://github.com/edenhill/librdkafka.git && cd librdkafka && ./configure --prefix=/usr && make && make install
    
    Login or Signup to reply.
  2. Looks like we are still waiting for 3.11 confluent-kafka. This is the only thing that is blocking my 3.10 to 3.11 upgrade.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search