coc-python icon indicating copy to clipboard operation
coc-python copied to clipboard

coc-python can not pick interpreter in venv

Open laoshaw opened this issue 4 years ago • 4 comments

I am running python inside a venv, I want to make sure the python points to the venv one, after that coc is trying to install pylint via "my/venv/python -m pip install -U pylint --user" but the flag '--user' is not supported in venv, somehow coc-python still has it.

ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

laoshaw avatar May 03 '20 23:05 laoshaw

I have the same problem

ACLeiChen avatar May 15 '20 18:05 ACLeiChen

I'm using a project with pipenv and it seems to work great there.

insidewhy avatar May 21 '20 08:05 insidewhy

@laoshaw , @ACLeiChen and @insidewhy this happens in a virtualenv when this is configured:

include-system-site-packages = false

@chemzqm , the code that add --user to pip install is here: https://github.com/neoclide/coc-python/blob/master/src/common/installer/moduleInstaller.ts#L40

Is there a way to check when this error happens:

ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

and to try whitout --user then?

I am not very savvy when it comes to typescript. I at least tried to remove the --user and confirmed that this fixed this issue.

Thanks in advance, Antoine

antoinemadec avatar Jun 07 '20 23:06 antoinemadec

Workaround from the upstream issue: https://github.com/microsoft/vscode-python/issues/14327#issuecomment-727288323

SergeyPoznyakAkvelon avatar Nov 19 '20 14:11 SergeyPoznyakAkvelon