Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Failed to detect/use Conda env python #89

Open
number5 opened this issue Sep 10, 2019 · 4 comments
Open

Failed to detect/use Conda env python #89

number5 opened this issue Sep 10, 2019 · 4 comments

Comments

@number5
Copy link

number5 commented Sep 10, 2019

Expected:

  • when running under an activated conda env, coc-python should use the python interpreter in that conda env

What happened:

  • coc-python still use system python

Steps to reproduce:

  • conda create coc-bug python=3.4
  • conda activate coc-bug
  • neovim test.py CoCStatus showing the system python instead of the python 3.4 from the env

Possible related microsoft/vscode-python#4434

@physicistgeng
Copy link

same issue, anyone can fix this?

@deto
Copy link

deto commented Sep 24, 2019

Similar issue, but working very strange for me. I have conda installed in two places on my system, but only one is on the path. Yet, somehow the python interpreter from the other install is being set as the default. This is not the interpreter that running python will launch (again, not on my path) and so I'm not even sure how coc-python (or vscode-python) is finding it.

I'd advocate for the default behavior being to use whatever interpreter is in front on the path.

Edit: Actually looks like the rules are defined here:

https://github.com/neoclide/coc-python/blob/a5ae8d6bf781ee00ceeef14bb129180c13415ff4/src/interpreter/autoSelection/index.ts

Though I'm still not sure why mine was being selected this way. I don't have an interpreter in my coc-settings.json files and I don't have a workspace set up (no .vscode directory where I'm working). Seems to point to either a bad interpreter being cached (does the cache persist across closing/opening nvim?) or maybe a poor setting for the globally preferred interpreter (where is this defined?)

@astier
Copy link

astier commented Dec 6, 2019

I would also prefer if coc-python would use the interpreter of the currently activated conda environment. Maybe a setting could be useful which could be set to define if one prefers the conda-interpreter or the interpreter which is set by coc.

@znculee
Copy link

znculee commented Apr 22, 2020

Duplicated with #55

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants