Tag Archives: Essay

Essay (19) Ubuntu 16 + python2.7 update PIP report error no module named typing

Last updated at 11:03:47, June 28, 2021

Every time you enter PIP related commands, there will be a line of yellow characters, prompting you to update pip to the latest version. Today, you can’t watch the update, and then you report a big error: Import error no module named typing
the reason is that pip21 and python2.7 do not match. The typing Library in the error report only appeared in python3.5, which is not available in python2.7
If I need to use ROS, I can only use python2.7 instead of updating the version. I can only use the old version of Pip to cover the current pip21, but now any command starting with PIP will report an error, so I can only use get-pip.py to implement the rollback version. Refer to the link: installing pip is not working in Python & lt; three point six

- curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py
- python get-pip.py
- python -m pip install --upgrade "pip < 21.0"

The third order here is unnecessary.

[study notes] a quick search of latex mathematical symbols

Basic operation

    multiplication

    x

    ×

    y

    x \times y

    X × y
    x times y power

    two

    three

    x

    2^{3x}

    23x
    2 ^ {3x} square root

    x

    +

    y

    \sqrt {x + y}

    x+y

    \ sqrt {x + y} Division

    x

    ÷

    y

    x \div y

    X △ y
    x / div y score

    x

    y

    \frac{x}{y}

    YX
    \ frac {x} {y} XOR

    \oplus


    \ oplus is less than or equal to

    x

    y

    x \leq y

    X ≤ y
    x / Leq y is greater than or equal to

    x

    y

    x \geq y

    X ≥ y
    x / GEQ y is not equal to

    x

    y

    x \neq y

    X  = y
    x / NEQ y round down

    x

    \lfloor x \rfloor

    ⌊ x ⌋
    – round up

    x

    \lceil x \rceil

    ⌈ x ⌉
    \sum\limits_ {x = 1} ^ {n} 7x integral

    0

    π

    two

    sin

    (

    x

    )

    \int_ {0}^{\frac{\pi}{2}} \sin(x)

    ∫02π​​sin(x)
    \int_ {0}^{\frac{\pi}{2}} \sin(x)

Set symbol

    belongs to

    A

    B

    A \in B

    A ∈ B
    A / in B does not belong to

    A

    B

    A \notin B

    A ∈ / b
    A / notin B subset

    A

    B

    A \subset B

    A⊂B
    A \subet B

Greek alphabet

    α

    \alpha

    α \alpha

    β

    \beta

    β \beta

    θ

    \theta

    θ \theta

    π

    \pi

    π \pi

Vector matrix

    vector $/ VEC {V} $
    / VEC {V} matrix

    $
    \begin{pmatrix}
    a_ n\
    1
    \end{pmatrix}

    \begin{pmatrix}
    A&B\
    0&1
    \end{pmatrix}
    \times
    \begin{pmatrix}
    a_ {n-1}\
    1
    \end{pmatrix}
    $

When local git connects to github: PTY allocation request failed on channel 0

In the afternoon, when I was playing Github on my computer, I found that the remote connection was always not successful. There was also a warning. Although warning did not affect anything, I just felt uncomfortable looking at it.
When entering the sSH-t [email protected] command, the process prompts yes for the first time. However, a successful message was not received after that. Instead, there was a warning and PTY Allocation Request failed on Channel 0 prompt.

After several twists and turns found that the command input is wrong…
Minus t should be capital.
The correct command is: ssh-t [email protected]

Process of checking the error of connection reset by peer reported by reactor netty

article directory

  • 1. An error phenomenon
  • 2. Screening process
      • 2.1 Connection reset by peer reason
      • 2.2 the syscall: read (..) Failed: Connection reset by peer error
  • 3. Final cause

1. Error reporting

A service in

group switched from spring-webmvc framework to spring-webflux. After running online for some time, the following error log occasionally appeared. L:/10.0.168.212:8805 represents the server IP and port where the local service is located. R:/10.0.168.38:47362 represents the server IP and port where the requested service is located. The common reason for this situation is that the server is busy, while checking the monitoring of the service invocation, it is found that the normal invocation amount is not enough to constitute the condition of service busy

2020-05-110 10:35:38.462 ERROR reactor-http-epoll-1 [] reactor.netty.tcp.TcpServer.error(300) - [id: 0x230261ae, L:/10.0.168.212:8805 - R:/10.0.168.38:47362] onUncaughtException(SimpleConnection{channel=[id: 0x230261ae, L:/10.0.168.212:8805 - R:/10.0.168.38:47362]})
io.netty.channel.unix.Errors$NativeIoException: syscall:read(..) failed: Connection reset by peer
	at io.netty.channel.unix.FileDescriptor.readAddress(..)(Unknown Source)

2. Screening

2.1 Connection reset by peer

The

error is rarely encountered. The first thing that comes to mind is, of course, searching for the wrong keyword on the Internet and finding the following. It is clear that Connection reset by peer is caused by the server transmitting data to the opposite Socket Connection closed, but the reason for closing the Connection to the opposite end is unknown

abnormal reason

java.net.BindException:Address already in use: JVM_Bind this exception occurs when the server side is operating new ServerSocket(port), because the port has been started and is listening. At this point with the netstat - an command, you can see the local has been in the use of state of the port, you just need to find a not occupied ports can solve the problem

java.net.ConnectException: Connection refused: Connect

the exception occurs on the client for the new Socket (IP, port) operation, the reason is unable to find the IP address of the machine (that is, from the current machine does not exist to the designated IP routing), or is the IP, but can not find the specified port monitor

java.net.SocketException: The Socket is closed

the exception can occur in both the client and the server, the reason is that their own initiative after closed the connection (call the Socket close method ) read and write operations on the network connection

java.net.SocketException: (Connection reset or Connect reset by peer)

the exception might occur in both client and server, for two reasons, first is if the end of the Socket is closed (or take the initiative to shut down or because of the closing of the anomalies caused by the exit, "mark> the default Connection Socket 60 seconds, 60 seconds without a heartbeat interactions, namely, speaking, reading and writing data, automatically close the Connection ), the other end is still to send data, The first packet sent throws this exception (Connect reset by peer). The other side exits without closing the Connection, and the other side throws an exception if it reads from the Connection again (Connection reset). simple say is to read and write operations after the connection is broken cause of

java.net.SocketException: Broken pipe this exception may occur on both the client and server. In the first case of the fourth exception (Connect reset by peer), if the data is written again, the exception

will be thrown

2.2 the syscall: read (...). Failed: Connection reset by peer error

continues searching for other keywords and then goes around and finds the issue of reactor-netty on github. github posted by other developers is almost exactly the same as what I encountered. After careful reading, I found that other developers encountered this problem mainly in the following two ways:

  • disabled long connections
  • modify the load balancing strategy to the minimum number of connections strategy

From the perspective of comment, this is mainly involved in the connection pooling mechanism of reactor-netty. We know that netty is a framework based on nio (see the Java IO model and examples), which USES a connection pool to ensure concurrent throughput when handling connection requests. By customizing the ClientHttpConnector with a long connection attribute of false, the connection pool thread is guaranteed not to be held for long periods of time, which seems to be an effective solution for this error

in scenarios used by other developers

3. Final cause

check the comment on github, I always feel that the scene of other developers is not exactly the same as ours, but I have no idea for the moment. The leader shouted in the internal group. In the evening, a colleague finally found the clue from the log.

>

>

>

>

>

>

>

  • connection pool allocates threads reactor-http-epoll-1 to process A request A. During the processing of reactor-http-epoll-1, due to the slow SQL blocking all the time, the same interface was accessed with high frequency during this period, and other threads in the connection pool were also allocated to process the same type of request. Then it also blocks because of slow SQL. in the connection pool threads are blocked, a new request to come over, connection pool has no thread can carries on the processing, therefore has been hold request end, closed until after the timeout active Socket . After that, the server Connection pool thread finally finished processing the slow SQL request, and then processed the backlog of requests. When it finished, it sent the data to the request side, only to find that the Connection had been closed, so the error Connection reset by peer was reported. As a rule of thumb, if the service reports a Connection reset by peer error, first check to see if there is a particularly slow action in the service blocking the thread

analysis of slow SQL found that the reason why the statement took so Long to execute was that the MySQL database field of data type VARCAHR accepted the condition of Long data type, resulting in implicit type conversion, unable to use the index, and thus triggering the full table scan.

WSL 2 needs to update its kernel components

welcome to my blog

problem description: open win10 terminal display: WSL 2 needs to update its kernel components;

download the upgrade package of WSL2 Linux kernel from Microsoft, download the link, as shown in the figure below, click “this link” to download

install the update package, all the way next, without any additional options

Change the Python installation path in Pycharm

Change the python installation path in

pycharm

introduction

sometimes python is installed in a path that is not suitable and python needs to be reinstalled. If pycharm has been installed before, a change in the new python path will cause pycharm to fail and the pycharm configuration needs to be changed. This article is to document how the Python path is changed in Pycharm.

operation method

click file – & gt; Setting

new changes, in turn, click the above button to choose python installation path can