Category Archives: How to Fix

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.

Tomcat memory overflow in Eclipse: Java. Lang. outofmemoryerror: permgen space solution:

1. Configure the size of this part of heap memory through the JVM parameter – XX: maxpermsize = 256M.  

2. How to configure the memory size of Tomcat in eclipse?

First, you need to double-click Tomcat server, as shown in the figure below:

Double click the figure above to display the Tomcat configuration interface

Then, click the link in the red rectangular box in the figure above, and the node of Tomcat parameter configuration will pop up. To select the arguments parameter box:

As shown in the figure above, you can set the value of – XX: maxpermsize = 256M in the VM arguments text box. Of course, you can add other JVM parameters, such as maximum memory, minimum memory, etc.

Uncaught ReferenceError: FileAsyncWriter is not defined

Question: problem:
Uncaught ReferenceError: FileAsyncWriter Writer is not defined
at Object.writelog (dScript_main_main_print_open-equipm.flow_main_cover-open carcarcarcarcarcarcarcards.js:34)
at E.that.that.ecolsMemberberFFunc (dScript_main_main_cover-up-against-openequiequiequiequiequiequiequipmor.flow_flow_print_open open open-reading carcarcarcarcarcarcarcards.js:81s:81)
at E.Z.ExecuteteScriptteScript Func (yhecols.js.js.js:js:1) at E.Z.ExecuteFunc2 (yhecols.js:1)
at E.DevicesEvent (yhecols.js:1)
at s.DispathEvent (yhecols.js:1)
at Y.UrlLoadCompelete (yhecols.js:1)
at yhecols.js:1
at yhecols.js:1
solution:
Add equipment YHFileAsyncWriter

Error reported by gulp: referenceerror: primordials is not defined

When running gulp related commands, the following error message appears:

reason:
If gulp version v3.9, node version v12.xx
there is a problem that the plug-in can not be used when installing gulp. The problem is that the gulp version is not compatible with the node version.

resolvent:

The syntax of gulp version upgrading to V4 – gulp3 has changed with gulp4. If upgrading, you need to make corresponding changes to gulp configuration file
downgrade the node version to v11 – node version. If the changes are made, the installation packages of other projects that depend on the node environment on the computer may have to be re installed to run correctly
upgrade the graded fs to version 4.2.2 that works under node V12 + (recommended).

Recommended solution:
. Create a new file npm-shrinkwrap.json in the same level directory of package.json, and enter the following contents:

{
    "dependencies": {
        "graceful-fs": {
            "version": "4.2.2"
        }
    }
}

Applet error – referenceerror: regeneratorruntime is not defined

When using the wechat developer tool to import the small program to run,
there is such a bug
small program error – referenceerror: regeneratorruntime is not defined

According to the prompts given by the editor, locate the place where the error is reported
the applet reports an error when using async to request data. Referenceerror: regeneratorruntime is not defined
find the problem and solve it

terms of settlement:

Click the details button in the upper right corner
and select local settings
to remove the check of ES6 to Es5

Refresh again
and the error will no longer appear

WebSocket failed: Error during WebSocket handshake: Unexpected response code: 400

The front-end and back-end architecture are separated, the development environment is normal, and the errors reported when deploying to the line are as follows:

Websocket error: websocket failed: error during websocket Handshake: unexpected response code: 400

It is obvious that the configuration of nginx does not support the reverse proxy of websocket, so the search and troubleshooting results are as follows:

The most important of them are the three lines

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

The first line tells nginx to use HTTP/1.1 communication protocol, which websoket must use. The second and third lines tell nginx to respond to the HTTP upgrade request when it wants to use websocket. Here, HTTP and websocket reverse proxy coexist, just a protocol upgrade

Supplement:

	server {
	        listen       80;
	        server_name  school.godotdotdot.com;
	        charset utf-8;
	        
			proxy_http_version 1.1; 
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection "upgrade";
	

	        location/{
	            proxy_pass http://127.0.0.1:3000;
	            proxy_set_header Host $host;
	            proxy_set_header X-Real-IP $remote_addr;
	            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	            proxy_connect_timeout 60;
	           proxy_read_timeout 600;
	           proxy_send_timeout 600;
	        }

	        error_page   500 502 503 504  /50x.html;
	        location = /50x.html {
	            root   html;
	        }
	 }

Fabric appears when trying to use application call: Unknown: access denied: Channel [mychannel] creator org [org1msp]

What happened

An unknown: access denied: Channel [mychannel] creator org [org1msp] error occurred when running the go application of “asset transfer” according to the official document of fabric.

resolvent

Open the go application and you can see that there are two folders, keystore and wallet, as shown in the following figure. The problem can be solved by deleting these two folders and running the application again

Cause of the problem

You may have run the application once before, and then these two folders will be generated. Then execute the command./network. Sh down and rebuild the network. This leads to errors
the specific reason is not clear, please ask the boss to answer.

About the problem of calling tools library by running Python program under Mac OS X, modulenotfoundererror: no module named ‘tools‘

ModuleNotFoundError: No module named ‘Tools’

For example, import the tools library into pcharm of MAC

from Tools.scripts.abitype import classify
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from sklearn import datasets
from minisom import MiniSom

The first line will report error!!!

It seems that it is very difficult to change the tools variable in MAC environment. The solutions are as follows

Direct import classify

import classify

The test is effective ~

configure: error: no acceptable C compiler found in $PATH

Error information:

[root@localhost keepalived-2.2.2]# ./configure --prefix=/usr/local/keepalived --sysconf=/etc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/app/server/keepalived-2.2.2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

Solution:

[root@localhost keepalived-2.2.2]# yum install gcc

TypeError: putText() missing required argument ‘text‘ (pos 2)

This error prompt means that the required parameter is not found, that is, the function in the code is missing the necessary parameter
for example, cv2.imshow(), the first parameter is the window name, so it treats the second input mat (image) as missing. If you don’t want to name the window, you can use the empty string as the first input parameter

cv2.imshow('', frame)

ERROR bag unindexed: 2021-6-23-0103all.bag. Run rosbag reindex.

1. Problem
if you want to run a. Bag file that hasn’t been used for a long time, run the command: rosbag info XXX. Bag , and find an error, as follows:

ERROR bag unindexed: 2021-6-23-0103all.bag.  Run rosbag reindex.

If you want to play it by force: rosbag play XXX. Bag , you can’t either. The error is as follows:

 [ INFO] [1624972506.447439941]: Opening 2021-6-23-0103all.bag
[FATAL] [1624972506.448068825]: Error reading from file: wanted 4 bytes, read 0 bytes

2. Solution
according to the error prompt, enter the command:

rosbag reindex xxx.bag

Two. Bag files will be generated, as follows:

in the picture, xx.orig.bag is the first package, and xxx.bag is the package after reindex.
finally, enter the command: rosbag info XXX. Bag to output normally, as follows:

Tensorflow reported an error when using session module: attributeerror: module ‘tensorflow’ has no attribute ‘session’, which has been solved

This function can only be invoked before creating any graph, operation or tensor. It can be used at the beginning of a complex migration project from tensorflow 1. X to 2. X.

A simpler method is found. When referring to tensorflow, you can directly use:
Import tensorflow.compat.v1 as TF