question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autocomplete doesn't work when reopen vscode

See original GitHub issue

hi i did install micropy-cli using pip install micropy-cli and using pip list i can see this: micropy-cli 3.6.0 but on every command using micropy including micropy init i have follwoing error:

PS G:\isis-projects-2022\microPython\blink> micropy init
Traceback (most recent call last):
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\git\__init__.py", line 87, in <module>
    refresh()
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\git\__init__.py", line 76, in refresh
    if not Git.refresh(path=path):
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\git\cmd.py", line 340, in refresh
    raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the  
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:       
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\Scripts\micropy.exe\__main__.py", line 4, in <module>
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\micropy\__init__.py", line 18, in <module>
    from micropy import data, lib, project, stubs, utils
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\micropy\project\__init__.py", line 5, in <module>
    from . import modules
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\micropy\project\modules\__init__.py", line 7, in <module>
    from .packages import DevPackagesModule, PackagesModule
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\micropy\project\modules\packages.py", line 12, in <module>
    from micropy.packages import (
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\micropy\packages\__init__.py", line 16, in <module>
    from .source_package import PackageDependencySource, VCSDependencySource     
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\micropy\packages\source_package.py", line 9, in <module>
    from git import Repo
  File "C:\Users\Hamid\AppData\Roaming\Python\Python39\site-packages\git\__init__.py", line 89, in <module>
    raise ImportError('Failed to initialize: {0}'.format(exc)) from exc
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the  
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:       
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet

what is the problem and how can i solve that

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
hhzhgitcommented, Feb 10, 2022

i don’t konw how to appreciate you your hint completey worked for me as u said i just change "python.languageServer": "None" to “python.languageServer”: “Pylance”, and autocomplete worked again

1reaction
dalibor-sanzerucommented, Feb 10, 2022

@BradenM could you please take a look on this? Looks liike CLI is not storing python.languageServer after VS CODE restart. Workround is in this thread. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autocomplete stops working after create a new file (#88660)
Create a new file. Write some code (or use snippet), and try to autocomplete a type/variable. Autocomplete doesn't suggest anything. The problem ...
Read more >
Intellisense not automatically working VSCode - Stack Overflow
Open the folder (i.e. open the File menu and click Open Folder...) with the *. sln file or project. json and VSCode will...
Read more >
Integrated Terminal in Visual Studio Code
Visual Studio Code has an integrated terminal to enable working in your shell of choice without leaving the editor.
Read more >
IntelliSense in Visual Studio Code
Troubleshooting. If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve...
Read more >
Editing Python in Visual Studio Code
Make sure you selected a valid interpreter path by running the Python: Select Interpreter command. The formatter is not installed in the current...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found