Tag Archives: vscode

Vscode Tensorboard Error: We failed to start a TensorBoard session due to the following error: Command fa

When vscode opens the tensorboard, an error is reported:We failed to start a TensorBoard session due to the following error: Command failed: conda activate python && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/zhangyulan/.vscode-server/extensions/ms-python.python-2022.14.0/pythonFiles/printEnvVariables. py CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’. To initialize your shell, run $ conda init < SHELL_NAME> Currently supported shells are: – bash – 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’.

The main reason for the above problems is the version update.

Solution:

1. Make sure that in the .vscode-server/bin directory, delete the lock file xxxx-lock xxx, or not if it is not there. The file is shown in the following figure.

2. Return the python and balance extensions of vscode to 2022.14.0 and 2022.9.10, respectively, which are the versions one month ago. But I can’t go back to the version one month ago, just go back to the version one year ago

[Solved] Vscode1.71.0 terminal error: `sed: illegal option — r`

Problem description

In the Mac environment, the terminal that comes with Vscode will show a sed prompt no matter what command it is.,There is no problem with using the built-in terminal

$ echo 'hi'
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ... ]
hi

System Environment

# system version
$sw_vers

ProductName: Mac OS X
ProductVersion: 10.14.4
BuildVersion: 18E2035

# vscode version
$ code -v
1.71.0
784b0177c56c607789f9638da7b6bf3230d47a8c
x64

Solution

Refer to the issue for a good solution to this problem

The official website also said that this problem will be fixed in the next version

Modify file /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh

Replace line 125

# __vsc_current_command="$(builtin history 1 | sed -r 's/ *[0 -9]+ +//')"
__vsc_current_command="$(builtin history 1 | sed -E 's/ *[0-9]+ +//')"

[Solved] VsCode + gfortran Compiler Error: error: ld returned 1 exit status

After a file is executed in the VsCode control panel, if a new f90 file is created (multiple programs share the same panel port), an error message as shown in the figure will often appear

Solution:
The tasks.json file should add the presentation property `

{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "compile",
        "type": "shell",
        "command": "gfortran",
        "args": [
          "-g",
          "${file}",
          "-o",
          "${workspaceRoot}\\${fileBasenameNoExtension}.exe"
        ],
        "problemMatcher": [],
        "group": {
          "kind": "build",
          "isDefault": true
        },
        "presentation": {
          "echo": true,
          "reveal": "always",
          "focus": false,
          "panel": "new", //Here shared means shared, after changing to new each process creates a new port
          "showReuseMessage": true,
          "clear": false
        }
      }
    ]
  }

“Shared” indicates sharing. After changing to new, each process creates a new port.

VScode: How to Solve Pylance Error (pip Library Files Installed)

View Python installation location

Enter in Terminal

where python

View PIP installation library file location

pip show <packagename>

Open vscode and set the library path

Ctrl+shift+p Open ` preference; Open Settings(JSON)

Add path

"python.analysis.extraPaths":[
	    "/root/miniconda3/lib/python3.9/site-packages",
        "/root/.local/lib/python3.9/site-packages",
        "...."
        ]

[Solved] tsc execute error in VSCode Terminal

Premise: node and typescript are installed

Error: execute TSC xxx.ts in vscode, an error will be reported.

Solution: the execution mechanism of vscode is limited. Just change the execution mechanism

Exit vscode and run as administrator.
step 1:
execute get-ExecutionPolicy and return Restricted, which means it is restricted.
step 2:
execute  set-ExecutionPolicy RemoteSigned
step 3:
execute get-ExecutionPolicy and return RemoteSigned

Perform the above steps and execute TSC xxx.ts again is OK

 

[Solved] vpython: AttributeError: ‘box‘ object has no attribute ‘idx‘

vpython : AttributeError: ‘box‘ object has no attribute ‘idx‘

Problem description

1. Problem Description:

After importing the VPython library, the errors reported after using the sphere class or box class in the VPython library are as follows:

the main error statement is the underlined part: attributeerror: 'box' object has no attribute 'IDX' (changing box to sphere is the same).

After debugging, it is found that the specific errors are as follows:

2. Solution

  1. Make sure vpython is installed
  2. Check the third-party libraries of the project environment for the packages autobahn and txaio, e.g. mine are autobahn version is 22.4.2, txaio version is 22.2.1.
  3. Lower the version of audobahn. If I lower the version to 22.3.2

Success!!!!!!!

VScode vue3 Project vetur Error [How to Solve]

The plug-in supported by vue3 should be volar. There was an old vue2 project plug-in vetur before, so an error will be reported
solution: create a new .vscode in the project and create a new file settings.json, which reads as follows:

{
    "vetur.validation.template": false,
    "vetur.validation.script": false,
    "vetur.validation.style": false,
}

Finally, restart vscode to solve the problem

[How to Solve] error Parsing error: x-invalid-end-tag

Error reporting result

error  Parsing error: x-invalid-end-tag

Error reporting analysis

When view renders tags as native HTML tags, because these tags are self-closing, an error will be reported if there is an end tag.

Solution:

The first method: remove the end mark and write it in the form of single label

The second method: turn off the reminder

File/Preferences/Settings

Enter vetur. valid ation.tem pl ate in the search field and uncheck it as the screenshot below.