Author Archives: Robins

[Solved] SystemError: Parent module ” not loaded, cannot perform relative import

The problem that peer modules can’t be called directly has not been solved by the relative import path solution on the Internet
finally, just put the file. Py in the new folder. By the way__ init__. Py related import statement
and then run
it’s strange that I used to associate. Py with__ init__. Py is put back under the same level file of import, or run
later I found that I changed two places, the root cause is not the same level or not the same level file!

Instead, the package calling the parent module should declare the upper folder of the folder where the file is located!

The final investigation is correct! It turns out that in the final analysis:

Python Import Error: SystemError: Parent module ‘‘ not loaded, cannot perform relative import

System error: parent module “not loaded, can not perform relative import when importing Python package

When using flash for web development, the structure of the project is reset as follows:
write the picture description here
when running the project again, the system error: parent module “not loaded, cannot perform relative import will appear. Through the error location, it is found that the problem is caused by the packet guidance.

from .app import create_ app

The “parent module” is not loaded and cannot be imported. Why is there such a problem
by viewing the project structure, use

from web_ flask.app import create_ app

At this time, there are more package guiding problems
write the picture description here
first locate yourself in views.py and delete the package guiding statement

from .models import Users

Then, use the local guide
from web_ Flash. App. Models import users
User = users (1 ‘sun’)
so far, the problem has been solved
or you can add the corresponding Python path with sys.path.append
to solve the problem———————

Gson Parsing exceptions: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

First, check whether your retrofit configuration is correct and resolve the exception

.addconverterfactory (gsonconverterfactory. Create()) is modified here to the gson’s

Retrofit retrofit = new Retrofit.Builder()
        .baseUrl(HTTP_URL)
        .client(getOkHttpClient())
        .addConverterFactory(GsonConverterFactory.create())
        //Replace the converter, the return value is directly String, easy to parse the same field of different types of json data yourself
        .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
        .build();

If this position is like this, report an error

Check whether your API path is correct, and see if there is a missing ‘/’ or something

Apache service can’t be started under xampp, reporting port occupancy class error [error] Apache will not start without the configured ports free!

When xampp is opened for the first time under Windows environment to start Apache service, there may be an error

12:19:49  [Apache] 	Problem detected!
12:19:49  [Apache] 	Port 443 in use by ""D:\Program Files (x86)\VMware\VMware Workstation\vmware-hostd.exe" -u "C:\ProgramData\VMware\hostd\config.xml"" with PID 6084!
12:19:49  [Apache] 	Apache WILL NOT start without the configured ports free!
12:19:49  [Apache] 	You need to uninstall/disable/reconfigure the blocking application
12:19:49  [Apache] 	or reconfigure Apache and the Control Panel to listen on a different port

It is easy to see from the error prompt that port 443 is occupied by VMware related services. The solutions are as follows:

1. Open the xampp control panel and click netStart

 

2. Find the service using port 443 in netStart and remember its PID

 

3. Open Task Manager and enter resource monitor

 

4. Find the service corresponding to the PID remembered before and shut it down

5. Restart the Apache service in xampp

Note: this method can also be used to solve other similar problems that the related services cannot be started because the port is occupied

 

 

error: ‘memcpy’ was not declared in this scope

Recently, I have to do something about real-time transmission. After doing it, I found it hard to find and install

He thought he could install it smoothly. He was very depressed when he installed it. Make always reported me wrong

make

This step is a problem.

sdh_ pocket_ reader.cpp:208: error: ‘memcpy’ was not declared in this scope

I don’t know if there are many people who can’t install it because of this situation, but I will make the same mistake. In fact, the solution is very easy. Just add the header file string. H to the program, that is, include & lt; string.h>

The same way. After the modification, the L is successfully installed in make and make install.

Solution to the error of automapper installation in vs2012 nuget

When vs2012 installs automapper under. Net 4.0, the following error will be reported:

‘automapper’ already has a dependency defined for ‘standard. Library’.

‘AutoMapper’ already has a dependency defined for ‘Standard.Library’.

It is found that the nuget Version (version 2.83 of vs2012) is lower, and the standard. Library framework is not supported.

 

There are two solutions

Method 1
nuget 2.12 supports the. Net standard framework used by automapper 5.0.1 nuget package, so nuget needs to be upgraded to nuget 2.12 or above downgrade the version of automapper to nuget compatible with the current version. After testing, 4.1.1 is installed perfectly, and microsoft.bcl is installed along with it. Await and async of. Net4.5 can be used
PM & gt; Install-Package AutoMapper -Version 4.1.1
Installing ‘AutoMapper 4.1.1’.
Successfully installed ‘AutoMapper 4.1.1’.

reference resources:

http://majing.io/questions/557

Reproduced in: https://www.cnblogs.com/yanglang/p/7065049.html

In IE6, “RES / C”: windows, system32, shdoclc. DLL, HTTP 403. HTM “.

In IE6, “res:// c://windows.system32.shdoclc.dll HTTP”_ 403.htm& http://.. (specific path) “is wrong. The reason is that my path in the background is “./admin/other directory”.

Where admin is in the root directory. In IE6, because “/” represents the root directory, another path will be added in front of the actual path.

Therefore, if the admin is already in the root directory and IE6, you only need to remove “/” and it can solve the problem.

This problem will lead to the following errors: 403 Forbidden, access forbidden, etc.

Reproduced in: https://www.cnblogs.com/gowhy/archive/2011/07/05/2097924.html

EnvironmentError:mysql config not found

MySQL for Python Library in Python is equivalent to the jdbc driver corresponding to MySQL in Java

1. Install MySQL first

sudo apt-get install mysql-server

 

2. Install MySQL Python

Download mysql-python-1.2.3.tar.gz (see the attachment) and unzip it to the specified directory.

Compile and configure MySQL Python in the decompressed mysql-python-1.2.3 directory

python setup.py build

At this time, the system reports an error: environmenterror: MySQL_ config not found

Obviously there is no mysql_ Configure this file

Execute find/- name MySQL_ Config, there is no data, indicating that there is no MySQL in the system_ Configure this file

 

 

Someone on the Internet explained that MySQL installed with apt get does not have mysql_ Config is the name of this file

Solution:

(1) Ubuntu next

Execute sudo apt get install libmysqld dev

(2) Fedora next

Execute sudo Yum install Python devel

If it appears: my_ Config. H: without that file or directory, execute: sudo Yum install MySQL devel

Note: Yum is also written in Python, and/usr/bin/Python is called by default. This is the python that comes with the system itself. You can install it in/usr/local/bin/python, so you’d better not uninstall the python that comes with the system. The python you download doesn’t have the yum module.

 

Execute at this time   find/-name mysql_ Config found this file under/usr/bin /

Then modify the site.cfg file in the mysql-python-1.2.3 directory

Remove MySQL_ Config = XXX and change to MySQL_ config=/usr/bin/mysql_ Config (in MySQL)_ The directory on the machine where the config file is located shall prevail.)

Execute the following command to compile and install successfully:

python setup.py build

python setup.py install

http://zhoujianghai.iteye.com/blog/1520666

[solved] win10 + office2016 error: library not registered, HResult: 0x8002801d

Sad today

{0} cannot cast a COM object of type ‘Microsoft. Office. Interop. Word. Applicationclass’ to interface type’ Microsoft. Office. Interop. Word_ Application”。 This operation failed because the queryinterface call to the COM component of the interface with IID “{00020970-0000-0000-c000-000000000046}” failed with the following error: the library is not registered( Exception from HResult: 0x8002801d (type_ E_ LIBNOTREGISTERED))。”}

My situation

1. Win10 + 64 bit
2. Re installed office2016, but previously uninstalled the professional version of office2016 and WPS

solve

Re install WPS, it’s OK.

Cause of error

WPS component conflicts with office component. This thing {00020970-0000-0000-c000-000000000046} may be related to WPS, and then I didn’t uninstall it completely. After the WPS is re installed, it will register the component, so no error will be reported.

reference resources

Thank you very much for your inspiration:
C # importing excel2010 has the problem of DLL loading failure or unregistered class library, 0x8002801d or 0x80029c4a

And, if you are not sure about the root cause of the error, you can try step by step:
failed to retrieve the component with CLSID {000209ff-0000-0000-c000-000000000046} in the com class factory, because of the following error: 80070005 denied access
there are four methods listed in this article. Of course, the simplest and most crude method is the last resort, which is to reload the system.

Call Excel to report an error (the exception comes from HResult: 0x80010105 (RPC)_ SERVERFAULT))

Method 1: wk. Visible = true can be set; But this method will open the excel, show the effect is not good.

Method 2: in Excel 2007, click “office button”, click “excel option”, click “add in”, select “com add in” in the bottom drop-down box, click “go” button, the box will pop up, remove the add in of PDF, then OK.

Layer loading failed! Exception from HResult: 0x80040228

When loading ShapeFile data in ArcEngine development, an error is reported: “layer loading failed! Exception from HResult: 0x80040228 “. The problem number belongs to the authorization problem. First, check whether to add a license control. After it has been added, it is found that the error reporting place is when creating the ShapeFile workspace, the following methods are adopted to solve the problem.

Open the program.cs class and add the following code in the corresponding position of the class:

(1)using ESRI.ArcGIS.esriSystem;

(2)

IAoInitialize m_aoinitialize = new AoInitializeClass();
m_aoinitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);  

As follows: