psf / black

The uncompromising Python code formatter
https://black.readthedocs.io/en/stable/
MIT License
39.27k stars 2.48k forks source link

Black Module no found (Cygwin, Python 3.8.3, black 20.8b1) #1932

Open slpenn13 opened 3 years ago

slpenn13 commented 3 years ago

When using black,vim with gvim / vim (8.0+) on cygwin. The install completes (receive success notification, see existence of .vim/black with 3.8 specific executables). But upon opening file (from command line, e.g. cygwin-X + terminal) any file receive black module not found. Error occurred irrelevantly of how (or where) install black (specific to 3.8.3).

Reproduce Install using PluginInstall psf/black after downloading into .vim/bundle open file (will see initial install) open additional file -- error will appear on command line

Expected behaviour

  1. Files opens without warning
  2. Successfully execute :BlackVersion from vim / gvim

Environment (please complete the following information):

Status

  1. Updated black,vim (ln 148)
    • import sys
    • print(sys.path)
    • import black

At command line determined vim was referencing 3.7.7.1 (dynamic linking did not work). All files in system path corresponded to 3.7.7.1 not 3.8.3. This was also confirmed by pyven.cfg. The install in .vim/black corresponded to Python3 (3.8.3). Cygwin by default installed 3.7 in addition to 3,8, Updated python 3.7.7.1 adding pip, vitrualvenv (from cygwin). Then installed black using python3.7 -m pip install black (into system site-packages). Now vim / gvim loads black and runs :BlackVersion w/ no issue. Thanks, slp.

JelleZijlstra commented 3 years ago

I'm not familiar with Cygwin, but is there anything Black could do to fix this? It sounds more like an issue with vim and/or Cygwin.

slpenn13 commented 3 years ago

Thank you for your reply. I ran across multiple people with base error and wanted to expose one cause and possible first resolution steps. .The issue corresponds to black.vim. Black.vim neds to recognize recognize vim specific python and install black in correct python path structure. Cheers, slp.