Category Archives: How to Fix

Pychart remote debugging display picture, tkagg error report troubleshooting

It’s convenient to use pychart remote debugging program, but PLT can’t display pictures.

You can refer to pycham to remotely connect to the server and display the picture_ Cowboy does not catch a cold blog – CSDN blog

 

The following is the troubleshooting of errors reported by Matplotlib. Use (‘tkagg ‘) during the recent use of Matplotlib. Record it:  

Use the remote server debugger. In order to display the picture, modify matplotlib.use to report an error.

Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running

Xshell failed to open successfully. The error is eliminated after restarting xshell and xming.

But xming doesn’t pop up a window to display pictures. Restart debugging, here comes again

 

Then the above problem is probably not xshell and xming. Check env in the terminal and see display = localhost: 12.0

Recheck the pycharm running configuration. First clear the environment variable

Delete the display environment variable and display successfully.

After debugging and looking again, the error is reported again.

Check env again, display = localhost: 10.0

Add display = localhost: 10.0 again, the debugging is successful, try again, no problem, OK

Pikachu vulnerability is installed in the shooting range, and an error is reported when connecting to the MySQL database

During the installation of Pikachu vulnerability shooting range, the processing methods of connecting to MySQL database and reporting errors are as follows:

1. Confirm that the database can be connected normally. Try connecting with tools. If it is not normal, please check the configuration problems such as service, user name and password
2. Modify the IP address, user name and password of the database in config.inc.php to the IP, user name and password of the database. Both the root directory and pkxss have this file and need to be modified.

Config.inc.php in the root directory \ pkxss \ Inc also needs to be modified. It’s difficult.

Python server run code ModuleNotFoundError Error [How to Solve]

1. Problem description

A piece of Python code runs normally on the local ide. After it is deployed to the server for operation, a modulenotfounderror: no module named ‘xxx’ error occurs.

2. Cause of problem

The package of other files (self written package, not installed by PIP) is introduced into the code. What’s the problem  import that line.

The reason for the error is that the path on the server side is different from our local path.

3. Solution example

To solve this problem, you can add the following code at the top of your code:

import sys
import os
sys.path.append(os.path.dirname(sys.path[0]))

perhaps

import sys
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, BASE_DIR)

4. The above codes of sys.Path.Append() and sys. Path.Insert() can ensure that you can switch to the directory where the currently executed script is located at any time, which can be adjusted according to the directory structure where your script is located.

Used in Python programs import xxx, the python parser will search XXX in the current directory, installed modules and third-party modules. If it fails to search, an error will be reported.

sys.path  The module can dynamically modify the system path. The path imported by this method will become invalid after the python program exits.

sys.path  It’s a list, so it’s easy to add a directory in it. After adding, the new directory will take effect immediately. In the future, every time import operation may check this directory.

1. sys.path.append()

In the sys.path temporary end of the list to add the search path, convenient and concise import other packages and modules. The path imported by this method will become invalid after the Python program exits.

Example:

import sys

sys.path.append('..') # Indicates to import the upper directory of the current file into the search path

sys.path.append('/home/model') # absolute path

from folderA.folderB.fileA import functionA

 

2. sys.path.insert()

You can define the search priority. The sequence number starts from 0, indicating the maximum priority, sys.Path.Insert() is also a temporary search path, which will become invalid after the program exits.

Example:

import sys

sys.path.insert(1, "./model")

 

An error is reported when SQL server deletes a table foreign key constraint

  Create two tables tbltesta and tbltesb, and delete tbltesta


			create table dbo.TblTestA(
			Id					bigint			primary key identity(1, 1),
			name			varchar(20)     unique,
		    )
	
			create table dbo.TblTestB(
			Id					bigint			primary key identity(1, 1),
			TestAId				bigint			not null foreign key references 
			Status				varchar(1),
	     	)

Error reported: it is referenced by a foreign key constraint

Reason: other tables refer to the foreign key of this table

solve:

1. Find the foreign key of this table referenced by other tables

   exec   sp_ Helpconstraint ‘table name’;

2. Find the associated foreign key constraint table name

    select name
    from   sys.foreign_ key_ columns f join sys.objects o on f.constraint_ object_ id=o.object_ id  
    where f.parent_ object_ id=object_ ID (‘foreign key association table name ‘)

 

3. Delete the foreign key constraint

  Alter table foreign key constraint table   Drop constraint name (constraint name found above)

   
4. Delete table (events can be added)

BEGIN TRY
    BEGIN TRANSACTION
        ALTER TABLE TblTestB DROP CONSTRAINT FK__TblTestB__TestAI__635CD8E4
        DROP TABLE dbo.TblTestA
    COMMIT TRANSACTION
        PRINT 'commit sucesss'
END TRY
BEGIN CATCH
    ROLLBACK TRANSACTION
    PRINT 'rollback sucesss'
END CATCH

 

 

Dbeaver startup error and dbeaver installation configuration

About the error “version 1.8.0 301 of the JVM is not suitable for this product. Version: 11 or greater is required.”

1. Download Windows 64 bit (zip) under community from the official website of dbaver, and download and unzip it directly

2. After decompression, open the directory file, find dbeaver.exe and create a shortcut

3. Right click the shortcut and properties, add – VM D:/bigdata/software/JDK/bin/javaw.exe after the “target” path, and click apply and OK.

Generally, after performing the above operations, you can normally open the dbeaver shortcut. But some computers still can’t be turned on for some reasons. I checked many methods on the Internet. In the configuration file of dbaver, insert two lines above – vmargs:

-vm

D:/bigdata/software/jdk/bin/javaw.exe

However, the error version 1.8.0 is still reported when dbeaver is started on my computer_ 301 of the JVM is not suitable for this product. Version: 11 or greater is required.

I tried many methods on the Internet and still couldn’t solve it. Finally, I accidentally found that I put it in the dbeaver configuration file

-vm

D:/bigdata/software/jdk/bin/javaw.exe

Insert it into the next two lines of – vmargs. After saving, create a new shortcut and repeat step 3.

be careful!!! Be sure to add these two lines under – vmargs

Synchronous update: error from dbeaver startup ➕ Installation configuration – brief book (Jianshu. Com)

Solution to error 2059 reported on MySQL 8 via Navicat link error information:

#Error message:

the reason for this error is the encryption rule MySQL in versions before MySQL 8_ native_ Password, and the encryption rule after MySQL 8 is caching_ sha2_ password。 There are two ways to solve this problem. One is to update the Navicat driver to solve this problem, and the other is to modify the encryption rules of MySQL user login to MySQL_ native_ password。 The second method is adopted here
# solution
log in to the database
set the password to never expire

alter user 'root'@'localhost' identified by 'root' password expire never;

Set the encryption rule to MySQL_ native_ password

alter user 'root'@'localhost' identified with mysql_native_password by 'root';

Access Navicat again and you will be prompted that the connection is successful

Error reported by expdp / impdp data pump

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at “SYS.UTL_FILE”, line 536
ORA-29283: invalid file operation

Cause: Oracle failed to read the default backup directory

resolvent:

1. Recreate the logical directory with an administrator such as system (if you want to have the same name as the original logical directory, you need to delete the directory and recreate it first)

Create directory mydata as’ logical directory path ‘;

For example: create directory mydata as’/data/Oracle/mydata ‘;

Delete directory:   drop directory   mydata

2. Check whether the logical directory is created successfully

select * from dba_ directories

  3. Re expdp export or impdp import data. If the default logical directory used before needs to specify the directory

impdp system/ [email protected] remap_ schema=mydb:testdb   directory=mydata DUMPFILE=data1.dmp table_ exists_ action=replace