Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running :Black in Neovim (installed via vim-plug) throws error: "invoking 'python_execute' on channel 3 (python3-script-host)" #2392

Closed
erikr opened this issue Jul 22, 2021 · 1 comment

Comments

@erikr
Copy link

erikr commented Jul 22, 2021

Describe the bug

Running :Black in a fresh install of Neovim (via Homebrew), with black installed via vim-plug, results in the following error:

Error detected while processing function provider#python3#Call:
line   18:
Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 97, in <module>
ModuleNotFoundError: No module named 'black'
Error detected while processing function black#Black[1]..provider#python3#Call
:
line   18:
Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'Black' is not defined

To Reproduce

  1. Install neovim via brew install neovim.
  2. Install pynvim via conda install -c conda-forge pynvim.
  3. Install vim-plug.
  4. Add Plug 'psf/black', { 'branch': 'stable' } to ~/.config/nvim/init.vim.
  5. Install plugins via nvim -c PlugInstall, or inside of neovim, running :PlugInstall.
  6. Close and reopen neovim, then run Black via :Black.

Expected behavior
black formats Python code without the errors.

Environment (please complete the following information):

  • Plugin manager: vim-plug
  • Version of black: I have Plug 'psf/black', { 'branch': 'stable' } in my init.vim
  • OS and Python version: macOS 11.4, Python 3.9.5 (in system; unclear exact version in Neovim)
  • Neovim version:
    NVIM v0.5.0
    
    Build type: Release
    LuaJIT 2.1.0-beta3
    Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/build/config -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/src -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20210702-14987-rep9di/neovi-0.5.0/build/src/nvim/auto -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/build/include
    Compiled by brew@BigSur
    
    Features: +acl +iconv +tui
    See ":help feature-compile"
    
       system vimrc file: "$VIM/sysinit.vim"
      fall-back for $VIM: "/usr/local/Cellar/neovim/0.5.0/share/nvim"
    
    Run :checkhealth for more info
    

Does this bug also happen on main?

No.

Additional context

@hauntsaninja
Copy link
Collaborator

Closing as a duplicate of #2547

@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants