fisadev / vim-isort

Vim plugin to sort python imports using https://github.com/timothycrosley/isort
MIT License
219 stars 32 forks source link

No isort python module detected when typed commond Isort #29

Closed kelein closed 4 years ago

kelein commented 5 years ago

I have been already installed isort via pip:

$ pip install isort
Requirement already satisfied: isort in ./Library/Python/2.7/lib/python/site-packages (4.3.4)

$ pip3 install isort
Requirement already satisfied: isort in /usr/local/Python36/lib/python3.6/site-packages (4.3.4)

And configured in my .vimrc: Plugin 'fisadev/vim-isort' and then PluginInstall.

But when type Isort command it occurs this:

No isort python module detected, you should install it.

Meanwhile, It works well when I directly use it by isort some.py in terminal.

My vim version 8.1.400.

tony commented 5 years ago

We can add pip/virtualenv support similar to black's:

https://github.com/ambv/black/blob/master/plugin/black.vim (it's MIT licensed)

Black's vim plugin seems to work out-of-the-box on my machines.

tony commented 5 years ago

There is a weakness with black's vim plugin: It doesn't take note of the project's configuration, like it would if you were doing it via the commandline.