Category Archives: How to Fix

$GOPATH/go.mod exists but should not

The reason for this is that after the module support is enabled, it cannot be connected with the

G

O

P

A

T

H

common

Save

,

place

with

hold

term

order

from

Gopath coexists, so the project from

Gopath coexists, so you can remove the project from gopath

Reproduced at: https://my.oschina.net/pokdars/blog/2222300

There is a problem with newtonsoft.json.dll after adding plastic SCM

There is a problem with newtonsoft.json.dll after adding plastic SCM

A while ago, I opened a new personal project. Because it is a new project, I use the latest ones for everything I want. Therefore, I used plastic SCM officially launched by unity for version control
the plug-in was installed at the beginning. There was nothing wrong with it and it was OK to use. But as the project code piles up, well, the problem arises.

Because I use the powerful newtonsoft. JSON library. After it was added to the project, there was nothing wrong with using it a few days ago and it can be used normally. However, when I used this library in the code of the editor, I referenced the newtonsoft.json namespace and found that the problem came out. Unity kept reporting errors:

There are two in the project newtonsoft.json. This baffled me. After positioning, I found that there is also a newtonsoft.json Library in the plastic SCM package:

good heavens! You also changed someone’s name, # ¥% @# ¥, at least you also changed the namespace… You have a big surprise! Well, I’ll admit it. Who told me to use your stuff

Since you are determined to use it, I’ll think about how to solve it. Because I had no problem in the non editor code before, it may be that the JSON Library in the SCM package itself only runs in the editor mode, and some of the editor codes we wrote refer to the library in the SCM package… Speechless

My current solution:

Option 1:

Delete the original library and copy the in plastic SCM to the project to keep the versions of the two DLLs consistent:

1. Delete the JSON library referenced by ourselves in the project

2. Right click to find the physical path of the JSON Library in plastic SCM:

3. Find it and copy it to the plugins directory of our project, and modify its name as newtonsoft.json.dll

4. Then enter the project and wait for the compilation to be completed

Option 2:

Do not delete the JSON library you put into the project, and keep it coexisting with plastic SCM. However, there are requirements for the storage location of the physical path of the code file because. Asmdef is used.

1. Sort out the code of our editor and create an asmdef file (assembly definition file) in the relative root directory of the code:

For example, in my project, I was working on a level editor, so I sorted the code of the level editor into a levelmaker/scripts directory, and then right-click in the levelmaker directory to create asmdef:

As for sorting the code, if you do well in directory planning in the early stage, there should be no problem. As for how much code an asmdef file contains, it depends on the situation of the project. Some projects are more fine-grained. As for the code of the editor, I generally like to divide it by each tool.

2. After creating the. Asmdef file, unity will enclose our editor code and finally compile it into an independent DLL. Check the override reference option in the setting of. Asmdef, and the assembly references setting item will appear:

3. Add a reference to the dot product + sign, select the DLL file we need to specify the reference, and wait for compilation after applying

4. Finally, don’t forget to check the platform option in the settings, otherwise there will be problems in compiling when publishing

Option 3:

This method is not recommended because I haven’t used it. Just think of

Copy the plastic SCM separately, which is not maintained by packagesmanager, and put it in the plugins directory, so we can do whatever we want… For example, replace the JSON library it refers to with our own… Well, this sounds a bit like scheme 1… In fact, unity has also modified the JSON library it refers to

I don’t recommend it. After all, packagesmanager maintenance is very good, and any version iteration can be updated as soon as possible… After all, plastic SCM is just a tool

Option 4:

Find the source code of the JSON library, and compile your own JSON library after modification… Um…
newtonsoft. JSON library source code: https://github.com/JamesNK/Newtonsoft.Json

ImportError: cannot import name ‘SummaryWriter‘ from partially initialized module ‘torch.utils.tenso

ImportError: cannot import name 'SummaryWriter' from partially initialized module 'torch.utils.tensorboard' (most likely due to a circular import)

The reason for this is that the file you named is duplicate with the system file. Remember to check it and try to avoid duplication with the system name, otherwise it is easy to make mistakes when importing the package

ClobberError: The package ‘xxx‘ cannot be installed due to a path collision for ‘xx‘ This path alre

Original link: https://stackoverflow.com/questions/51217876/conda-update-anaconda-fails-clobbererror?newreg=2c51dd84b04b42c49294714471612f07

The reason for this problem is that the versions of related packages such as CONDA and pip are too low to be updated automatically. Solution: enter the following command on the command line:

conda clean --all
conda update --all

When Maven hits the jar package, an error is reported when executing install, and the symbol cannot be found in a line

Record the problems encountered:

Since the problem has been solved before posting, there is no picture, please watch and think patiently!

Today, when preparing to deploy a project with a jar package, an error is reported in install. According to the idea prompt, it is locked in a line of a class

According to the error prompt, I found that I created a new class in package B, and the jar package I am typing is package a,

1. So I checked pom.xml in project a to see if the dependency of package B was introduced. It was confirmed that it had been introduced

2. I thought it might be that I didn’t print jar package for project B, so I tried to package project B first and then print package a

valueError: Length mismatch: Expected axis has 40 elements, new values have 38 elements

Background

I take the original model and prepare to run a new dataset. Of course, the columns will be different
the new dataset does not have a head, so I’m stupid to count a number of columns (it should be wrong. My original number of 38 is actually 40)
and report valueerror: length mismatch: expected axis has 40 elements, new values have 38 elements error

Solution ideas

My English is poor, so Google translated what this sentence means
valueerror: length mismatch: the expected axis has 40 elements and the new value has 38 elements

That is to say, I counted wrong
in order to prove it, I must output. The shape result is (100000, 40) OK, then I’ll recognize it and change it

Data processing and analysis

Before getting the dataset, you’d better take a shape to see how many rows and columns

train_df=pd.read_csv('data/train_small.txt',header=None,sep='\t')
print(train_df.shape)

Get (10000, 40)

For a dataset without a head, you need to define a header name

train_df.columns=['click']+['f'+str(i) for i in range(39)]
features=['f'+str(i) for i in range(39)]

It’s that simple

I write 39 because the target value in front of me has this

Error reason

It’s mainly because you can’t count.
it’s clearly said that there are 40 columns, so don’t be stubborn. Only 38 columns will be finished. Small mistakes are very simple

ModuleNotFoundError: No module named ‘notebook‘

ModuleNotFoundError: No module named ‘notebook’

Problem modulenotfounderror: no module named ‘notebook’

This problem occurred when running notebook today. Now I’d like to share with you how to solve this problem

terms of settlement

    open the terminal: Win + R, enter “CMD”, then “enter”
    activate the environment when you run the code: “CONDA activate + your environment name”
    after entering your environment, enter “Python – M PIP install Jupiter”, and then “enter”
    appears at the bottom to indicate that the installation is successful
    then enter: IPython notebook
    . This page indicates that the problem has been solved

[problem record] installed build tools revision 31.0.0 is broken during Android studio compilation

Error: * * build tool 31.0.0 is missing DX at XXXX (SDK installation address) * * the same error as the title

resolvent

do not use the latest build tools, uninstall the latest packaging tool

Use a different version of build tools instead

Step 1: set up the SDK manager

The setting method is as follows:

    in the top column, select toolsdkmanager, remove the check of Android API 31 and apply SDK platforms as needed, such as Android 11.0 ®, And apply

    The completion result is shown in the figure:

    The second step is to set up the build.gradle file

    1、 Open the build.gradle file in the location shown in the figure
    note: the second build.gradle file opens here. When the mouse is over, module: modulename.app displays

    2、 Modify the contents of the build.gradle file as shown in the figure

    PS: find the SDK version number used by the current simulator

    The current simulator uses the SDK version, which can be viewed by clicking AVD manager in the upper right corner

    or after modifying targetsdkversion, directly click sync and modify it according to the corresponding warning information.

    reference resources:

      [problem record] unity package Android error: & gt; Failed to find build tools revision 30.0.0unity package APK error: failed to find build tools revision 31.0.0 or other versions of Android studio installation, the most detailed in history (more pictures)!! Installation of Android studio (the problem of gradle failure in the supplement is updated on March 10, 2021)

      Thanks to the author of the above article

Fixed Frame [base_link] does not exist

If this problem occurs, please check whether gazebo is started and whether gazebo can load the model normally. If not, then rviz most likely the corresponding node will not be loaded.

If gazebo is started, nodes can be selected after the fixed frame. If it is not started, it cannot be selected.

 

Vue3 uses element plus package to solve the problem of occasionally disordered code on the icon after it goes online

Unlike element UI, element plus does not use node sass or dart sass, but sass and sass loader. At first, I thought it might be that the sass version and sass loader version of the project are inconsistent with the version of element plus, so I deleted the version of my project and installed the version consistent with the version used by element plus, but the problem is not solved. The version is as follows:

 "devDependencies": {
    "postcss-loader": "^5.3.0",
    "sass": "^1.35.1",
    "sass-loader": "^10.0.1",
  }

After tossing around for a while, I found an article on the Internet (the solution of icon garbled code packaged by dart sass compiled element UI). This is a solution for element UI, but I don’t know whether it is effective for element plus. Therefore, after using this method for element plus according to the instructions, I found that it is also effective, so I made a record, The steps are as follows:
1. Install the plug-in CSS Unicode loader;

yarn add css-unicode-loader -D //npm install css-unicode-loader -D

2. In vue.config.js configuration, I used the object writing method, and here it is modified to function writing method

// vue.config.js
module.exports = {
  configureWebpack: config => {
    config.module.rules.filter(rule => {
      return rule.test.toString().indexOf("scss") !== -1;
    }).forEach(rule => {
        rule.oneOf.forEach(oneOfRule => {
          oneOfRule.use.splice(oneOfRule.use.indexOf(require.resolve('sass-loader')), 0,
          	{ loader: require.resolve("css-unicode-loader")})
        })
      })
    }
}

Android Studio – add configuration for Android studio

The following errors occurred:

  Obviously, the ADB is connected to the device, and the gradle compilation has passed, but the device cannot be loaded.

Later, after many attempts, it was found that the SDK version of Android studio just downloaded was too high, so we can choose a lower version.

  After removing the √ in front of 31, I selected the Android 8.0 version. After installation, it will be bound.

Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.4.0:repackage failed

When spring boot performs the packaging operation, the following errors are reported:

Execution default of goal org.springframework.boot:spring-boot-maven-plugin:XXXX RELEASE:repackage failed: Unable to find main class

The root cause is that in my project scenario,

Only the – boot sub module as shown in the figure produces executable jar packages. Other modules do not need to be executable. In my root POM, spring boot helps me add the following build strategy by default

< build>
        & lt; plugins>
            & lt; plugin>
                & lt; groupId> org.springframework.boot
                & lt; artifactId> spring-boot-maven-plugin
            & lt;/ plugin>
        & lt;/ plugins>
    & lt;/ build>

The solution is relatively simple, that is, remove the build part of the Spirng boot for all modules and put it into the sub module you need to package. Here is the API service boot module, Other modules do not need to produce executable jars.
————–
copyright notice: This article is an original article of CSDN blogger “@ within” and follows the CC 4.0 by-sa copyright agreement. Please attach the source link of the original text and this notice for reprint
original link: https://blog.csdn.net/qq_ 41264674/article/details/106539584