Tag Archives: note

How to Solve c3p0 error (Cause & Solution)

Error Cause & Solution:
1. Configuration is wrong: driver=com.mysql.jdbc.Driver.
2. Wrong database connection address: url=jdbc:mysql://localhost:3306/test (test is user-defined creation, variable).
3. Wrong password or account: username=root (default is root).
4. Wrong account: password=root (password is set by the user).
5. The database is not started or not authorized to access.
6. The corresponding driver jar package mysql-connector-java-5.1.6-bin.jar has not been introduced, or the mysql-connector-java dependency has not been injected in the Maven project.

Error creating bean with name ‘adminMapper‘ Injection of resource dependencies failed

Project scenario:

springboot project, unable to create bean object and inject dependency


Problem Description:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'adminService': 
 Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 
'adminMapper' defined in file [E:\IdeaCode\toyrentalplatform\target\classes\cn\gestwr\toy\dao\AdminMapper.class]: Unsatisfied dependency expressed through bean property 
'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException:

Cause analysis:

It is the configuration file application Properties


Solution:

the configuration options of the configuration file are wrong, for example, the following configuration is added and an error is reported

mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

In the properties file, the color of this configuration is different from that of other configurations. The correct one is light green

Note the format of the YML configuration file

[Solved] SpringBoot+Dubbo Startup Error: Fail to start server(url: dubbo://192.168.0.9:20880/service

When using springboot + Dubbo, an error is reported when starting the project

All error messages are as follows:


org.apache.dubbo.rpc.RpcException: Fail to start server(url: dubbo://192.168.0.9:20880/service.UserInfoService?anyhost=true&application=user-login-service&bind.ip=192.168.0.9&bind.port=20880&channel.readonly.sent=true&codec=dubbo&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&heartbeat=60000&interface=service.UserInfoService&metadata-type=remote&methods=selectUesers,deleteUser,registerUser,updateUser,selectUser,findAllUsers&pid=83072&qos.accept.foreign.ip=false&qos.enable=false&release=2.7.8&side=provider&timestamp=1641785798014) Failed to bind NettyServer on /192.168.0.9:20880, cause: Address already in use: bind
	at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:348) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.openServer(DubboProtocol.java:320) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.export(DubboProtocol.java:303) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:64) ~[dubbo-rpc-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:155) ~[dubbo-rpc-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:66) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-common-2.7.8.jar:2.7.8]
	at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$2(RegistryProtocol.java:255) ~[dubbo-registry-api-2.7.8.jar:2.7.8]
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_302]
	at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:253) ~[dubbo-registry-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:205) ~[dubbo-registry-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:62) ~[dubbo-rpc-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:153) ~[dubbo-rpc-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:64) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-common-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:492) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:325) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:300) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:206) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$15(DubboBootstrap.java:1103) ~[dubbo-2.7.8.jar:2.7.8]
	at java.util.HashMap$Values.forEach(HashMap.java:981) ~[na:1.8.0_302]
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:1090) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:901) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:59) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:52) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.config.spring.context.OneTimeExecutionApplicationContextEventListener.onApplicationEvent(OneTimeExecutionApplicationContextEventListener.java:40) ~[dubbo-2.7.8.jar:2.7.8]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.14.jar:5.3.14]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.14.jar:5.3.14]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.14.jar:5.3.14]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.14.jar:5.3.14]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.14.jar:5.3.14]
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938) ~[spring-context-5.3.14.jar:5.3.14]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.14.jar:5.3.14]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.2.jar:2.6.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) [spring-boot-2.6.2.jar:2.6.2]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.6.2.jar:2.6.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) [spring-boot-2.6.2.jar:2.6.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [spring-boot-2.6.2.jar:2.6.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) [spring-boot-2.6.2.jar:2.6.2]
	at com.clc.userlogin7000.demo.UserLoginApplication.main(UserLoginApplication.java:12) [classes/:na]
Caused by: org.apache.dubbo.remoting.RemotingException: Failed to bind NettyServer on /192.168.0.9:20880, cause: Address already in use: bind
	at org.apache.dubbo.remoting.transport.AbstractServer.<init>(AbstractServer.java:77) ~[dubbo-remoting-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.remoting.transport.netty4.NettyServer.<init>(NettyServer.java:77) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.remoting.transport.netty4.NettyTransporter.bind(NettyTransporter.java:35) ~[dubbo-2.7.8.jar:2.7.8]
	at org.apache.dubbo.remoting.Transporter$Adaptive.bind(Transporter$Adaptive.java) ~[dubbo-common-2.7.8.jar:2.7.8]
	at org.apache.dubbo.remoting.Transporters.bind(Transporters.java:56) ~[dubbo-remoting-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchanger.bind(HeaderExchanger.java:44) ~[dubbo-remoting-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.remoting.exchange.Exchangers.bind(Exchangers.java:70) ~[dubbo-remoting-api-2.7.8.jar:2.7.8]
	at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:346) ~[dubbo-2.7.8.jar:2.7.8]
	... 39 common frames omitted
Caused by: java.net.BindException: Address already in use: bind
	at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_302]
	at sun.nio.ch.Net.bind(Net.java:463) ~[na:1.8.0_302]
	at sun.nio.ch.Net.bind(Net.java:455) ~[na:1.8.0_302]
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:233) ~[na:1.8.0_302]
	at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) ~[netty-common-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503) ~[netty-transport-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[netty-common-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.72.Final.jar:4.1.72.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.72.Final.jar:4.1.72.Final]
	at java.lang.Thread.run(Thread.java:853) ~[na:1.8.0_302]

See the error message from top to bottom

  1. 1. com.alibaba.dubbo.rpc.RpcException: Fail to start server service failed to start2. Caused by: com.alibaba.dubbo.remoting.RemotingException: Failed to bind NettyServer on /192.168.194.1:20880, cause: Failed to bind to: /0.0.0.0:20880 Failed to bind to port 20880 of this machine

    3. Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:20880 Attempt to bind the service to port 20880 of this machine failed

    4. Caused by: java.net.BindException: Address already in use: The bind address has already been used

Solution:

application.yaml or application.properties configuration file port from 20880 to 20881 can be modified because I have configured 20880 in other modules, so here again configuration will report a duplicate binding exception ~ ~

[Solved] internal compiler error Killed (program cc1plus)

g++: internal compiler error: Killed (program cc1plus)

g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
gmake: *** [cmGeneratorTarget.o] Error 4
---------------------------------------------
Error when bootstrapping CMake:
Problem while running gmake
---------------------------------------------
Log of errors: /root/cmake-3.22.0/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

The reason is insufficient memory. The solution is to increase swap partition

[root@ALiYunOgenes cmake-3.22.0]# free -h
              total        used        free      shared  buff/cache   available
Mem:           991M        465M        257M        1.1M        268M        379M
Swap:            0B          0B          0B
[root@ALiYunOgenes cmake-3.22.0]# dd if=/dev/zero of=/var/swap bs=1024 count=2048000  
2048000+0 records in
2048000+0 records out
2097152000 bytes (2.1 GB) copied, 19.0987 s, 110 MB/s

[root@ALiYunOgenes cmake-3.22.0]# mkswap /var/swap 
Setting up swapspace version 1, size = 2047996 KiB
no label, UUID=d5ede89f-d76a-4b53-9ec9-256a9370fcfe

[root@ALiYunOgenes cmake-3.22.0]# swapon /var/swap 
swapon: /var/swap: insecure permissions 0644, 0600 suggested.
[root@ALiYunOgenes cmake-3.22.0]# vi /etc/fstab 
…………
/var/swap swap swap defaults 0 0
…………

[root@ALiYunOgenes cmake-3.22.0]# free -m          
              total        used        free      shared  buff/cache   available
Mem:            991         466          58           1         465         374
Swap:          1999           0        1999
[root@ALiYunOgenes cmake-3.22.0]# 

How to Solve nacos Startup Error and Connect to MYSQL

Error reason for Nacos startup: the default configuration of Nacos is cluster startup, which can be modified to stand-alone startup (after Nacos 1.3.2, the default mode of Nacos is cluster mode).

The Nacos directory structure is as follows (the version of Nacos I use is 2.0.3):

1.open the bin directory and modify startup.com script

2.connects to MySQL, executes the SQL statement

opens the conf folder, creates a Nacos database, executes the following script

after execution, the results are as follows

3.opens the conf folder, modifies the configuration information

finds the following configuration in the conf folder and modifies the marked configuration items

test access 127.0 0.1:8848/Nacos account/password: Nacos/Nacos successfully opened the following page

DingDing Error: missing mainframe dll [How to Solve]

Repair steps:
1. Press “windows logo key + X”, Start Windows PowerShell (administrator) Enter the command “auto repair system
2. Dism/online/cleanup image/scanhealth” to scan all system files and compare them with the official system files to scan for inconsistencies in the computer
3. The command dism/online/cleanup image/checkhealth must be used when the system file is found to be damaged after the previous command is executed
4. Dism/online/cleanup image/restorehealth this command restores those different system files into official system source files
5. Restart after completion. No matter whether the above is successful or not, type the following command: SFC/scannow

[Solved] Kafka in Windows error:java. nio. file. Filesystemexception: this file is in use by another program and cannot be accessed by the process

Problem description

Kafka deployed in Windows environment hangs up after running for a period of time
view logs logs/server Log the following errors are found:

 ERROR Failed to clean up log for __consumer_offsets-44 in dir D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs due to IOException (kafka.server.LogDirFailureChannel)
java.nio.file.FileSystemException: D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs\__consumer_offsets-44\00000000000000000000.timeindex.cleaned -> D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs\__consumer_offsets-44\00000000000000000000.timeindex.swap: 另一个程序正在使用此文件,进程无法访问。

	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
	at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:387)
	at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287)
	at java.nio.file.Files.move(Files.java:1395)
	at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:904)
	at kafka.log.AbstractIndex.renameTo(AbstractIndex.scala:210)
	at kafka.log.LazyIndex$IndexValue.renameTo(LazyIndex.scala:155)
	at kafka.log.LazyIndex.$anonfun$renameTo$1(LazyIndex.scala:79)
	at kafka.log.LazyIndex.renameTo(LazyIndex.scala:79)
	at kafka.log.LogSegment.changeFileSuffixes(LogSegment.scala:496)
	at kafka.log.Log.$anonfun$replaceSegments$4(Log.scala:2402)
	at kafka.log.Log.$anonfun$replaceSegments$4$adapted(Log.scala:2402)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at kafka.log.Log.replaceSegments(Log.scala:2402)
	at kafka.log.Cleaner.cleanSegments(LogCleaner.scala:613)
	at kafka.log.Cleaner.$anonfun$doClean$6(LogCleaner.scala:538)
	at kafka.log.Cleaner.$anonfun$doClean$6$adapted(LogCleaner.scala:537)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at kafka.log.Cleaner.doClean(LogCleaner.scala:537)
	at kafka.log.Cleaner.clean(LogCleaner.scala:511)
	at kafka.log.LogCleaner$CleanerThread.cleanLog(LogCleaner.scala:380)
	at kafka.log.LogCleaner$CleanerThread.cleanFilthiestLog(LogCleaner.scala:352)
	at kafka.log.LogCleaner$CleanerThread.tryCleanFilthiestLog(LogCleaner.scala:332)
	at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:321)
	at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:96)
	Suppressed: java.nio.file.FileSystemException: D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs\__consumer_offsets-44\00000000000000000000.timeindex.cleaned -> D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs\__consumer_offsets-44\00000000000000000000.timeindex.swap: 另一个程序正在使用此文件,进程无法访问。

		at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
		at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
		at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:301)
		at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287)
		at java.nio.file.Files.move(Files.java:1395)
		at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:901)
		... 20 more

reason

When the consumer offsets the log cleanup or the log file scrolls, Kafka broker will shut down because the file renaming fails. This is because cannot modify the file in use in windows.

Solution

In server In the properties configuration file:
1.Modify log retention. Hours = - 1
2.Add log at the end of the file cleaner. Enable = false
3.Restart

Suggestion

There are similar issues and PR in GitHub, but they are not merged. The author uses kafka_2.13-2.8.0 version has this problem. Kafka is not recommended for win environments.

[Solved] Docker failed to delete image error: no such image: CentOS

The docker image cannot be deleted. If you view the image through docker images, it clearly exists, but it cannot be deleted.

Deletion prompt: error: no such image: XXXXXXXX

The specific screenshots are as follows:

Problem solving:

get into

cd /var/lib/docker/image/overlay2/imagedb/content/sha256

This directory is all the image files in docker

Which to delete? Don’t panic, image ID in docker images can determine the image file.

Delete the file after confirmation: RM -rf + file name

After deletion, there is no in the docker images list.

How to Solve PIP3 install oct2py error

use sudo pip3 install oct2py error: ERROR: Cannot uninstall ‘pexpect’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Solution: sudo pip3 install oct2py –ignore-installed pexpect
Install successfuly!

[Solved] Python-selenium locates an element cannot be clicked error: ElementClickInterceptedException

Problem Description:

prompt: elementclickinterceptedexception: Message: element click
when performing selenium UI automation test, you may encounter the situation that elements can be located but cannot be clicked. The following error is:

When writing an automatic program, you will encounter a new window pop-up, and the program always locates the element on the first window page by default. In this way, the element will not be located, and the program will report an error.

For example, when locating an element, the UI is covered by the pop-up window in the list. If an element cannot be located, the program reports an error
click the code of the located element:

web_driver.find_element(By.CSS_SELECTOR,'#funtype_click').click()

Cause analysis:

prompt: elementclickinterceptedexception
when locating an element, the UI is covered by the pop-up window in the list. If an element cannot be located, the element click has been blocked</ font>


Solution:

Error code:

# Click on the function category
web_driver.find_element(By.CSS_SELECTOR,'#funtype_click').click()

Resolved Code:

# Functional Category
funtype_click = web_driver.find_element(By.CSS_SELECTOR,'#funtype_click')
web_driver.execute_script('arguments[0].click()',funtype_click)

[Solved] Python operate Kafka error: SyntaxError: invalid syntax

Python operation Kafka reports an error: return ‘& lt; SimpleProducer batch=%s>’ %self.async

return ‘< SimpleProducer batch=%s>’ % self. async
^^^^^
SyntaxError: invalid syntax

reason:

Because PY3 Async has become a keyword in 7. This leads to incompatibility.

Solution:

Method 1:

The latest Kafka version is used, but the Kafka on pypi has not been replaced with the latest one. You can upgrade Kafka Python using the following method
PIP install Kafka python

Method 2:

Just switch to version 3.6 and wait for subsequent upgrades