Black: ModuleNotFoundError: No module named 'black'

Created on 2 Jan 2019  ยท  1Comment  ยท  Source: psf/black

Operating system: Archlinux
Python version: 3.7.1
Black version: 18.9b0

I have followed the guide and I use vim-Plug I have successfully installed the plugin and it works just fine.
then I do workon mypersonalvenv and after that if I wanna open vim it says:

$ vim main.py 
Error detected while processing /home/aran/.vim/plugged/black/plugin/black.vim:
line  124:
Traceback (most recent call last):
  File "<string>", line 56, in <module>
ModuleNotFoundError: No module named 'black'
Press ENTER or type command to continue

when I press enter and then run :Black I get:

Traceback (most recent call last):
File "", line 1, in
NameError: name 'Black' is not defined

when I run :PlugInstall it says:
- black: Already installed
Also vim has created these files:

/home/aran/.vim/black
โ”œโ”€โ”€ bin
โ”‚ย ย  โ”œโ”€โ”€ activate
โ”‚ย ย  โ”œโ”€โ”€ activate.csh
โ”‚ย ย  โ”œโ”€โ”€ activate.fish
โ”‚ย ย  โ”œโ”€โ”€ python
โ”‚ย ย  โ””โ”€โ”€ python3
โ”œโ”€โ”€ include
โ”œโ”€โ”€ lib
โ”‚ย ย  โ””โ”€โ”€ python3.7
โ”‚ย ย      โ””โ”€โ”€ site-packages
โ”œโ”€โ”€ lib64 -> lib
โ””โ”€โ”€ pyvenv.cfg

6 directories, 6 files

Most helpful comment

The problem was that I was already inside my personal environment when I ran :PlugInstall now I removed ~/.vim/black and deactivaded my venv and opened vim again(automatically installs black) and then did workon mypersonalvenv and it works just fine now.

>All comments

The problem was that I was already inside my personal environment when I ran :PlugInstall now I removed ~/.vim/black and deactivaded my venv and opened vim again(automatically installs black) and then did workon mypersonalvenv and it works just fine now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

testvinder picture testvinder  ยท  3Comments

madig picture madig  ยท  3Comments

layoaster picture layoaster  ยท  3Comments

dimaqq picture dimaqq  ยท  3Comments

dgnsrekt picture dgnsrekt  ยท  3Comments