Tag Archives: IDE

Pycharm error: original error was: DLL load failed while importing _multiarray _Umath: the specified module could not be found

Anaconda is installed under the window system and the virtual environment is configured
everything runs normally using the command line, but an error is reported when running on pychram:
original error was: DLL load failed while importing _multiarray _umath

Tried:
1. Uninstall numpy and reinstall numpy
2. Add the python path again many times in the python settings

Final solution:
add system variables

after installing anaconda, only the first two are added, but not enough!!! \Bin and \library\bin should also be added!!!

Since it runs normally on the command line, the version problem between packages can be ignored. The problem must be the configuration of pycharm or system variables

Reference link: https://github.com/conda/conda/issues/7833

NameError: name ‘xrange‘ is not defined [How to Solve]

The reason is that my Python version is Python 3.8, while the xrange() function is in Python 2.0 For a function in X, in Python 3, the implementation of range () is the same as that of xrange (), so there is no special xrange (). Therefore, when this problem is encountered, there are two methods to solve it.

Solution:

1: if you want to run the program in Python 3, change all xrange() functions to range().

2: put the program with this problem in Python 2.X version of the environment can be run

[Solved] Eclipse Update Error: An error occurred while uninstalling session context was…

When updating Eclipse, the following error was reported:

An error occurred while uninstalling session context was:
(profile=D__…_…_eclipse_jee-2021-09_eclipse, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.platform.ide.executable.win32.win32.x86_64 4.21.0.I20210906-0500 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
Backup of file D:…eclipse.exe failed.
Can not remove : D:…eclipse.exe

 

Solution:

    1.Run eclipse and Rename eclipse.exe to eclipse.exe.back
    2.Run updates
    3.Updates executed successfully

简而言之就是在启动eclipse后,再把eclipse exe重命名为eclipse.exe.back然后更新。
希望能帮到更新时也有报此错误的童鞋!

[Solved] Android Studio Error: CreateProcess error = 206 file name or extension is too long

When Android studio develops Android projects, the error “CreateProcess error = 206” is easy to appear every time it runs. The console error message says that the file name or extension is too long. I used openjdk to solve this problem. I found many ways to solve it. For a long time, I can only restart Android studio or forcibly end the JDK process in the application manager. Later, I just changed the open JDK to Oracle JDK.

VScode Run CONDA environment Error [How to Solve]

In the CONDA environment using vs code, running the program will report the following problems

conda activate base

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.

To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - cmd.exe
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

After online search, the solution is as follows. Method 2 can be used for pro test:

Method 1:

Use the anaconda navigator or Anaconda PowerShell prompt provided by Anaconda to enter the environment, or enter CONDA Bat activate “environment path”, such as CONDA batactivate”D:\Anaconda3\envs\test”

Method 2:

Step 1:

Open the administrator power shell, modify the execution policy, execute: get executionpolicy, reply restricted, indicating that the status is prohibited

Restricted – default setting, no scripts are allowed to run
allsigned – only scripts signed by digital certificates can be run
remotesigned – local scripts do not need digital signatures, but scripts downloaded from the network must have digital signatures
unrestricted – all scripts are allowed to run

Step 2:

Execute: set executionpolicy remotesigned

Step 3:

Input: CONDA init

At this time, the configuration file profile will be generated under C:\users\XXX\documents\windowspowershell ps1

After restarting the power shell or vs code, it will enter the base environment of CONDA by default

Recovery:

Delete profile ps1.

According to personal conditions, execute the set executionpolicy restricted policy and change it back to restricted.

[Solved] git review Error: UnicodeDecodeError: ‘gbk‘ codec can‘t decode

The error message is similar to:

UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xac in position 44: illegal multibyte sequence

Solution:
find the python installation directory or directly search the subprocess Py, find the installation place. Python 38-32\lib\ has a file subprocess Py, encoding = none is changed to encoding = ‘UTF-8’.

VScode: How to Solve golong plug-in install Error

An error is reported when installing the go plug-in for vscode under Windows:

...
Installing golang.org/x/tools/gopls@latest FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "D:\\Program Files\\Go\\bin\\go.exe install -v golang.org/x/tools/gopls@latest",
 "stdout": "",
 "stderr": "go install: golang.org/x/tools/gopls@latest: module golang.org/x/tools/gopls: Get \"https:///goproxy.cn/golang.org/x/tools/gopls/@v/list\": http: no Host in request URL\n"
}
...

Most people can’t go to GitHub, but I can go up here. The report here is no host
after a lot of queries, it is found that most of them are agents, and then go to GitHub to download them, and then execute them. I still report an error after downloading
the solution is recorded here.

Method 1: update the environment variable and configure the download agent address

Or open PowerShell and enter:

$env:GO111MODULE="on"
$env:GOPROXY="https://goproxy.io"
go env -w GOPROXY=https://goproxy.cn,direct
//go env -w GOPROXY=https://goproxy.io,direct
go env -w GOPRIVATE=*.corp.example.com

goproxy.IO and goproxy.Cn is OK

Executing the following command in the terminal will output go Evn configuration

go env

set GO111MODULE=on
set GOARCH=amd64
set GOBIN=D:\Program Files\Go\bin
set GOCACHE=C:\Users\admin\AppData\Local\go-build
set GOENV=C:\Users\admin\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\server\GO\pkg\mod
set GONOPROXY=*.corp.example.com
set GONOSUMDB=*.corp.example.com
set GOOS=windows
set GOPATH=D:\server\GO
set GOPRIVATE=*.corp.example.com
set GOPROXY=https://goproxy.io
set GOROOT=D:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.17.5
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\admin\AppData\Local\Temp\go-build957788953=/tmp/go-build -gno-record-gcc-switches

Note that gopath is the dependent package directory of go, and goroot is the installation directory of go

If it is executed in the vscode terminal, the update will not be seen until the terminal is closed and then output. Only restart the vscode terminal, and the configuration displayed here will not change!

Then, Ctrl + Shift + P in vscode to call up the search term, enter go install, select go: Install/update tools, and then select all to execute

Here I see that many people have successfully implemented it, but I don’t think it will work.

Method 2: manually download the plug-in project (clone)

Create a folder in the% gopath% Directory:
Src/golang org/x/

Open the terminal and switch to% gopath%/SRC/golang Under org/X/directory, execute clone:

 cd $env:GOPATH/src/golang.org/x/
 git clone https://github.com/golang/tools.git
 git clone https://github.com/golang/lint.git

My% gopath% directory is D:\server\go, and the current directory is as follows:

Then switch to% gopath%\SRC\golang. In the terminal Org\x\

go install -v golang.org/x/tools/gopls

But I still failed here. Hint:

PS D:\server\GO\src> go  install -v golang.org/x/tools/gopls
go install: version is required when current directory is not in a module
        Try 'go install golang.org/x/tools/gopls@latest' to install the latest version

After adding the @latest version, the installation succeeded:

PS D:\server\GO\src> go install -v golang.org/x/tools/gopls@latest
...
PS D:\server\GO\src> go install -v github.com/haya14busa/goplay/cmd/goplay@latest
...
PS D:\server\GO\src> go install -v github.com/go-delve/delve/cmd/dlv@latest
...
PS D:\server\GO\src> go install -v github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest
PS D:\server\GO\src> go install -v github.com/cweill/gotests/gotests@latest
PS D:\server\GO\src> go install -v github.com/fatih/gomodifytags@latest
PS D:\server\GO\src> go install -v github.com/josharian/impl@latest
PS D:\server\GO\src> go install -v github.com/haya14busa/goplay/cmd/goplay@latest

In front of this is the directory used, followed by GitHub COM, because my local error is vs automatic installation, I reported both addresses, so I tried to install both
above.

How to Solve jupyter notebook Read CSV files Error

import pandas as pd
df = pd.read_csv('Pokemon1.csv',index_col = 0)

An error is reported after executing the code: Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0x89 in position 1538: invalid start byte
an error is still reported when trying to manually specify the encoding format [encoding = “UTF-8″/encoding = “GBK”):

df = pd.read_csv('Pokemon1.csv',index_col = 0,encoding="gbk")

Solution:
1 Find the CSV file used -> Right mouse button -> Opening method -> Select Notepad
2 Open the file and select File -> “Save as”, you can see that the default code is ANSI. Select UTF-8 to save a copy again, and then open it with PD.Read_csv(). There will be no error:


[Solved] python Error: GuessedAtParserWarning: No parser was explicitly specified

f:\py\verification.py:148: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 148 of the file f:\py\verification.py. To get rid of this
warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor.

It can operate normally, but an error message is prompted on the output console

soup = BeautifulSoup(response, ‘html’)

add: Features = "lxml" is fine

soup = BeautifulSoup(response, features="lxml")