Category Archives: Error

[Solved] tf.summary Error: tags and values not the same shape

Recently, TF. In tensorflow has been used The summary module is debugged to print the shape and value of the tensor you want to see when the main program runs

Although tensorflow version 1.15.5 is used, even tf.enable_eager_execution() also cannot see the length of the actual dimensions of the tensor.

TF Code of summary section:

edges_0_shape = tf.Print(tf.shape(edges_0), [tf.shape(edges_0)])

tf.summary.scalar('shape_edges_0', edges_0_shape)

Error message:

tensorflow.python.framework.errors_impl.InvalidArgumentError: tags and values not the same shape: [] != [2]

Explanation: edges_0 is a tensor and a two-dimensional tensor, so TF The return value of shape (edges_0) is a one-dimensional tensor such as [100, 50], so TF.summary.tensor_Summary () should be used, not TF.summary. scalar()

After modification:

edges_0_shape = tf.Print(tf.shape(edges_0), [tf.shape(edges_0)])
tf.summary.tensor_summary('shape_edges_0', edges_0_shape)

During the operation of the main program, it is printed as follows:

[Solved] TestNg Package Error: Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

Solution:

Add the following codes in the pom file:

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

[Solved] Error creating bean with name ‘xxxxController’: Unsatisfied dependency expressed through field ‘xxxxService’;

Error message:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'passportController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'usersMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'usersMapper' defined in file [D:\__study\web\imooc\foodie-dev - 副本\foodie-dev-mapper\target\classes\com\imooc\mapper\UsersMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map 'com.imooc.mapper.CategoryMapperCustom.' referenced from 'com.imooc.mapper.CategoryMapperCustom.getSubCatList'
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.7.jar:5.3.7]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.7.jar:5.3.7]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.0.jar:2.5.0]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.5.0.jar:2.5.0]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438) [spring-boot-2.5.0.jar:2.5.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:337) [spring-boot-2.5.0.jar:2.5.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1336) [spring-boot-2.5.0.jar:2.5.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1325) [spring-boot-2.5.0.jar:2.5.0]
    at com.imooc.Application.main(Application.java:22) [classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'usersMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'usersMapper' defined in file [D:\__study\web\imooc\foodie-dev - 副本\foodie-dev-mapper\target\classes\com\imooc\mapper\UsersMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map 'com.imooc.mapper.CategoryMapperCustom.' referenced from 'com.imooc.mapper.CategoryMapperCustom.getSubCatList'
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.7.jar:5.3.7]
    ... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'usersMapper' defined in file [D:\__study\web\imooc\foodie-dev - 副本\foodie-dev-mapper\target\classes\com\imooc\mapper\UsersMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map 'com.imooc.mapper.CategoryMapperCustom.' referenced from 'com.imooc.mapper.CategoryMapperCustom.getSubCatList'
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.7.jar:5.3.7]
    ... 34 common frames omitted
Caused by: org.apache.ibatis.builder.IncompleteElementException: Could not find result map 'com.imooc.mapper.CategoryMapperCustom.' referenced from 'com.imooc.mapper.CategoryMapperCustom.getSubCatList'
    at org.apache.ibatis.builder.MapperBuilderAssistant.getStatementResultMaps(MapperBuilderAssistant.java:396) ~[mybatis-3.5.5.jar:3.5.5]
    at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:285) ~[mybatis-3.5.5.jar:3.5.5]
    at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:113) ~[mybatis-3.5.5.jar:3.5.5]
    at org.apache.ibatis.session.Configuration.lambda$buildAllStatements$2(Configuration.java:860) ~[mybatis-3.5.5.jar:3.5.5]
    at java.util.Collection.removeIf(Collection.java:414) ~[na:1.8.0_201]
    at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:859) ~[mybatis-3.5.5.jar:3.5.5]
    at org.apache.ibatis.session.Configuration.getMappedStatements(Configuration.java:755) ~[mybatis-3.5.5.jar:3.5.5]
    at tk.mybatis.mapper.mapperhelper.MapperHelper.processConfiguration(MapperHelper.java:279) ~[mapper-core-1.1.5.jar:na]
    at tk.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:93) ~[mapper-spring-1.1.5.jar:na]
    at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[spring-beans-5.3.7.jar:5.3.7]
    ... 44 common frames omitted
Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.imooc.mapper.CategoryMapperCustom.
    at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:1009) ~[mybatis-3.5.5.jar:3.5.5]
    at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:718) ~[mybatis-3.5.5.jar:3.5.5]
    at org.apache.ibatis.builder.MapperBuilderAssistant.getStatementResultMaps(MapperBuilderAssistant.java:394) ~[mybatis-3.5.5.jar:3.5.5]
    ... 55 common frames omitted

Error reason: the method in mybatis does not write resultmap. In fact, the error report has given the problem:

Could not find result map 'com.imooc.mapper.CategoryMapperCustom.' referenced from 'com.imooc.mapper.CategoryMapperCustom.getSubCatList'。

[Solved] Transparent background PNG Convert to JPG with Balck Background Issue

You can just draw the bitmap onto a new bitmap.
This will also handle the cases of partial transparency, and also not need thousands of p/invokes with the Get/SetPixel (this is very, very slow).

var original = SKBitmap.Decode(inputStream);

// create a new bitmap with the same dimensions
// also avoids the first copy if the color type is index8
var copy = new SKBitmap(original.Width, original.Height);

// we need a canvas to draw
var canvas = new SKCanvas(copy);

// clear the bitmap with the desired color for transparency
canvas.Clear(SKColors.White);

// draw the bitmap on top
canvas.DrawBitmap(original, 0, 0);

[Solved] Hbase Startup Normally but Execute Error: Server is not running yet

Error reporting information

hbase:001:0> list
TABLE

ERROR: org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet

There are two solutions
the first is because of the Hadoop mode
the cluster is not shut down normally, and Hadoop enters the installation mode, resulting in external inaccessibility. You can access it by turning off the security mode.

Start Hadoop first and then

HDFS dfsadmin – safemode get # view security mode
HDFS dfsadmin – safemode leave # turn off security mode
you can also view it through the Hadoop web page

Then restart HBase to access the client. The general problem can be solved.

Method 2: jar package conflict
slf4j-log4j12-1.7.25.Jar exists in both Hadoop and HBase and is started at the same time. The service cannot be accessed due to occupation

Solution: delete slf4j-log4j12-1.7.25.jar in HBase. this file is in HBase/lib/client-facing-hirdparty/.

Then remove the export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP=”true” comment from hbase-env.sh. You can remove the quotes, or just insert them if the configuration file does not have this information. The default value is false, which means that Hadoop’s libs are included.

Then restart HBase. If stop-HBase.sh is invalid. You can kill the process with the kill command

It is recommended to use one and two closing sequences at the same time. Close HBase first and then Hadoop

[Solved] Error: A is only ever to be used as the child of element, never rendereddirectly.Please wrap your in a .

There is a problem with the react routing version. Check the package JSON file, check the version of react router dom. If it is version 6, this problem will occur.

In the V6 version of react router, route has changed its usage.

  import React from "react"
  import Home from "./pages/home"
  import Mine from "./pages/mine"

  import {BrowserRouter, Routes, Route} from 'react-router-dom'

  function App() {
      return (
        <div className="App">
          <BrowserRouter>
            <Routes>
              <Route path="/home"  element={<Home/>}></Route>
              <Route path="/mine" element={<Mine/>}></Route>
            </Routes>
          </BrowserRouter>
        </div>
      )  
  }
  export default App;

In the V5 version,

  import React from "react"
  import Home from "./pages/home"
  import Mine from "./pages/mine"

  import {BrowserRouter, Routes, Route} from 'react-router-dom'

  function App() {
      return (
        <div className="App">
          <BrowserRouter>
              <Route path="/home"  component={Home}></Route>
              <Route path="/mine" component={Mine}></Route>
          </BrowserRouter>
        </div>
      )
      
  }
  export default App;

[Solved] appium Error: A new session could not be created

Error reported in appium:

selenium. common. exceptions. SessionNotCreatedException: Message: A new session could not be created. (Original error: Command failed: C:\\WINDOWS\\system32\\cmd.exe /s /c “D:\\tools\\Android\\android-sdk\\platform-tools\\adb.exe -s 127.0.0.1:62001 shell “ps ‘uiautomator'””

Execute the command in the error message in CMD:

The error message reported is: bad PID ‘uiautomator’

Solution:

1. Find ADB.JS file In the appium installation directory. directory:\appium\node_modules\appium\node_Modules\appium-ADB\lib
2. Open ADB.JS, find the following code:

ADB.prototype.shell = function (cmd, cb) {
  if (cmd.indexOf('"') === -1) {
    cmd = '"' + cmd + '"';
  }
  var execCmd = 'shell ' + cmd;
  this.exec(execCmd, cb);
};

3. Add the following code below the above code

//add
ADB.prototype.shell_grep = function (cmd, grep, cb){
    if (cmd.indexOf('"') == -1){
        cmd = '"' + cmd + '"';
    }
    var execCmd = 'shell' + cmd + '| grep ' + grep;
    this.exec(execCmd, cb);
};

4. Find the following code:

ADB.prototype.getPIDsByName = function (name, cb) {
  logger.debug("Getting all processes with '" + name + "'");
  this.shell("ps '" + name + "'", function (err, stdout) {
    if (err) return cb(err);
    stdout = stdout.trim();
    var procs = [];
    var outlines = stdout.split("\n");
    _.each(outlines, function (outline) {
      if (outline.indexOf(name) !== -1) {
        procs.push(outline);
      }
    });
    if (procs.length < 1) {
      logger.debug("No matching processes found");
      return cb(null, []);
    }
    var pids = [];
    _.each(procs, function (proc) {
      var match = /[^\t ]+[\t ]+([0-9]+)/.exec(proc);
      if (match) {
        pids.push(parseInt(match[1], 10));
      }
    });
    if (pids.length !== procs.length) {
      var msg = "Could not extract PIDs from ps output. PIDS: " +
                JSON.stringify(pids) + ", Procs: " + JSON.stringify(procs);
      return cb(new Error(msg));
    }
    cb(null, pids);
  });
};

4. Comment out the above code, start with/* and end with */comment

5. Replace with the following code

//replace
ADB.prototype.getPIDsByName = function (name, cb) {
  logger.debug("Getting all processes with '" + name + "'");
  this.shell_grep("ps", name, function (err, stdout) {
    if (err) {
      logger.debug("No matching processes found");
      return cb(null, []);
    }
    var pids = [];
    _.each(procs, function (proc) {
    var match = /[^\t ]+[\t ]+([0-9]+)/.exec(proc);
    if (match) {
    pids.push(parseInt(match[1], 10));
    }
    });
    if (pids.length !== procs.length) {
      var msg = "Could not extract PIDs from ps output. PIDS: " +
      JSON.stringify(pids) + ", Procs: " + JSON.stringify(procs);
      return cb(new Error(msg));
    }
    cb(null, pids);
  });
};

6. Restart appium

[Solved] reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response

Jetty service used by backend

report errors

2022-01-11 17:20:24.362  WARN 4784 --- [ctor-http-nio-3] r.netty.http.client.HttpClientConnect    : [id: 0x3eaaea4e, L:0.0.0.0/0.0.0.0:58790 ! R:localhost/127.0.0.1:8090] The connection observed an error

reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response

2022-01-11 17:20:24.362 ERROR 4784 --- [ctor-http-nio-3] a.w.r.e.AbstractErrorWebExceptionHandler : [31e53fe7-21772]  500 Server Error for HTTP GET "/status"

reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
	|_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ HTTP GET "/status" [ExceptionHandlingWebHandler]
Stack trace:

explain

Call the back-end service jetty through the gateway service spring cloud gateway and report an exception

reason

The back-end service automatically disconnects after the socket timeout, and the gateway service takes the disconnected connection from the httpclient connection pool to request

Reappearance

Spring Cloud GateWay : 2.2.1.RELEASE

Spring Cloud : Hoxton.SR1

Spring Boot : 2.3.4.RELEASE

Server uses springboot emulation

GateWay

spring:
  application:
    name: gateway
  cloud:
    gateway:
      httpclient:
        pool:
          max-idle-time: 60000ms
      routes:
      - id: dev
        uri: ${service-url.dev-service}/status
        predicates:
        - Path=/status
service-url:
  dev-service: http://localhost:8080
server:
  port: 8098

Server

spring:
  application:
    name: dev
server:
  tomcat:
    connection-timeout: 100ms

Jmeter

Threads:300
period seconds:5
Loop Count:20

explain:

Max idle time: maximum idle connection time

Connection timeout: timeout of socket read().

Gateway’s max idle time: the connection is released after 60000ms, and the connection timeout of the server is disconnected after 100ms. At this time, gateway will take the disconnected connection request from the connection pool, resulting in an error

 

Solution:

Because the server is the provider and the gateway is the consumer, try to ensure that the consumer disconnects before the provider, and the time for setting Max idle time is not greater than connection timeout

Jetty services

Jetty modified jetty.http.Idletimeout or http.timeout. Default 30000ms

 

Matplotlib.pyplot Plug-in Chinses Font Error: RuntimeWarning: Glyph 26376 missing from current font

Using Matplotlib When drawing with pyplot, add a Chinese font, which indicates that the font cannot be found. The solution is as follows

1. Download simhei Ttf (BOLD) font file;

2. Copy to D:\Python38\Lib\site-packages\matplotlib\mpl-data\fonts\ttf (My Catalog)

3. Modify the file D:\Python38\Lib\site-packages\matplotlib\mpl-data\matplotlibrc

 font.family         : sans-serif   
 # remove the previous #     
 font.sans-serif     : SimHei, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif  
 # remove the previous #, and add SimHei after the colon
 axes.unicode_minus  : False
 # remove the previous #, and change the True to False

4. Add code

# set the font
plt.rcParams['font.sans-serif'] = ['KaiTi', 'SimHei', 'FangSong'] 
plt.rcParams['font.size'] = 12 
plt.rcParams['axes.unicode_minus'] = False

5. Delete the buffer directory of Matplotlib
in the python environment of the terminal, enter the following command to view the font cache path of Matplotlib:

import matplotlib
matplotlib.get_cachedir()

Then exit the python environment and delete the cache directory on the terminal using the RM - RF + path

6. The font configuration is completed and can be used normally

K8s binary deployment start API-server error: Error: unknown flag: –etcdservers

 systemctl status kube-apiserver  failed to startup

check the error in the log

cat /var/log/messages|grep kube-apiserver|grep -i error

Jan 11 11:22:44 m1 kube-apiserver: --logtostderr                      log to standard error instead of files
Jan 11 11:25:16 m1 kube-apiserver: Error: unknown flag: --etcdservers
Jan 11 11:25:16 m1 kube-apiserver: --alsologtostderr                  log to standard error as well as files
Jan 11 11:25:16 m1 kube-apiserver: --logtostderr    

【Error: unknown flag: --etcdservers】 that I wrote the wrong string.

I copied the pdf content of the textbook; --etcdservers copied out and pasted into notepad, and found that the [-] symbol was missing.

chrome browser copy pdf - line feed content to notepad++ less [-] symbol

so pay attention to the differences in copying content.

Successful startup after correction