Author Archives: adminah

Ubuntu1.8 Install python3.7pip Error: “subprocess.CalledProcessError…lsb_release”

background

Install Python 3.7 on a Ubuntu 18.04. After that, try the PIP list command, and a long list of errors appear. I’ll post the last few lines:

File “/usr/local/lib/python3.7/subprocess.py”, line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.

When executing the PIP list command, the LSB cannot be found_Release – a this command
solutions

1. LSB found_Release.py this file

sudo find/-name ‘lsb_release.py’

The results shown here are as follows. There may be differences between different system versions:

/usr/share/pyshared/lsb_release.py
/usr/lib/python2.7/dist-packages/lsb_release.py
/usr/lib/python3/dist-packages/lsb_release.py

2. Select the path containing python3 and copy the file to the error path/usr/local/lib/python3.7/

sudo cp /usr/lib/python3/dist-packages/lsb_release.py/usr/local/lib/python3.7/

Try to execute PIP list again and return to normal.

Druid Error: c.a.druid.pool.DruidAbstractDataSource: discard long time none received connection.

C.a.druid.pool.druidabstractdatasource: discard long time none received connection

Make a simple record~

Many posts on the Internet say that there are about two ways to solve it:

1. Class file configuration, add configuration (invalid here)

    @PostConstruct
    public void init(){
        // discard long time none received connection
        System.setProperty("druid.mysql.usePingMethod", "false");
    }

2. The MySQL version has been adjusted accordingly (it is also invalid for me)

3. Add: – dduid.Mysql.Usepingmethod = false (valid) in the operation parameters

nohup java -Ddruid.mysql.usePingMethod=false -jar user-0.0.1-SNAPSHOT.jar --server.port=9092  >user.out &

Hive Start Error: Exception in thread “main” java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgumen

Error Messages:
Exception in thread “main” java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1380)

at org.apache.hadoop.util.RunJar.main(RunJar.java:236)

Cause:
The two guava.jar versions of hadoop and hive are inconsistent
The two locations are located in the following two directories.
– /usr/local/hive/lib/
– /usr/local/hadoop/share/hadoop/common/lib/

Solution:
Delete the lower version and copy the higher version to the lower version directory

If conditional statement in Bash reports an error [: missing `] ‘

This is my little demo

#!/bin/bash

read -p "Please input three numbers:" n1 n2 n3
if [ $n1 -gt $n2 ] && [ $n1 -gt $n3 ]
then
echo "max_num is $n1"
elif [ $n3 -gt $n2 ] && [ $n1 -lt $n3 ]
then
echo "max_num is $n3"
else
echo "max_num is $n2"
fi

The error [: missing `]] is reported mainly for the following reasons:

Spaces shall be used between if and ‘[‘, ‘[‘ and condition, ‘]’ and condition, ‘-GT’ and the number to be compared before and after;

When using relational operators’ && ‘ or ‘ | ‘in the middle, be sure to enclose the conditions before and after with square brackets.

R Language Error: rowMeans(new1) : ‘x’ must be an array of at least two dimensions

Use command:

new1$mean=apply(data.frame(new1),1,mean)
new1$mean=rowMeans(new1)

Generate error: rowmeans (new1): ‘x’ must be an array of at least two dimensions

Change the command to the following:

new1$mean=apply(as.data.frame(new1),1,mean)
new1$mean=rowMeans(new1)

Note that when using rows to calculate the average value, you need to convert “matrix” to “data. Frame”. You can’t directly use the data.Frame() function, but you need to use the as.Data.Frame() function;

The error reported by golang when referring to a third-party package: no required module provides package [perfect solution]

golang third-party package reference error: no required module provides package : go.mod file not found in current directory or any parent directory;
Package needs to be poured in.
go get github.com/denisenkom/go-mssqldb
go get github.com/mattn/go-adodb
No response from all of them, let’s analyze what the problem is.

Command: go env
First exclude go env inside: GO111MODULE (mine is GO111MODULE=”on”, resulting in download failure)

Execute: go env -w GO111MODULE=auto

Ubuntu System Goland Error: External file changes sync may be slow: The current inotify(7) watch limit is too low

 

vim /etc/sysctl.conf

Increase the value of fs.inotify.max_user_watches inside (or add the following line if you don't have this value).
fs.inotify.max_user_watches=524288

After saving, execute.
sysctl -p

Restart Goland it's OK

Link: https://stackoverflow.com/questions/65064450/how-to-fix-external-file-changes-sync-may-be-slow-the-current-inotify7-watch