Comments (10)
1 way to partially fix this is always prefers the current python environment. If vim was started inside a virtualenv then default the interpreter to virtualenv, if it was not then using the default python.
Remembering the choice is great but it might require some hard decision
from coc-python.
Fixed by use a json file (~/.config/coc/memos.json
) to store the selected python path.
The limitation is it can't support multiple workspaceFolders.
from coc-python.
I think I'm personally opposed to using .env, only because that's typically used for application configuration by a lot of frameworks (for example, pipenv automatically imports all vars in .env into the shell when activating the virtual environment). I'd personally prefer to keep my editor/IDE config separate from that to avoid any conflicts/complexity it could introduce.
from coc-python.
Still buggy, need some rework, the logic of this part form vscode-python is quite complex.
from coc-python.
VSCode create .vscode
folder with settings in your project, coc.nvim need to create .vim
folder with settings to resolve this problem.
from coc-python.
is there any plan on fixing this
Sure, will fix this ASAP.
from coc-python.
can we use .env file for some basic settings? Creating a .vim folder seems a bit overkill (no plugin is using it)
from coc-python.
is there any plan on fixing this - how else can I currently use the python interpreter inside /.venv
in whatever project I happen to be working in?
from coc-python.
I am having the same issue as @ntcong when I try to select a different python interpreter with the quickpick menu. The interpreter doesn't seem to change from its initial value no matter what I choose. I am using:
- coc-python v1.1.4
- pipenv 2018.11.26
- python 3.7.3 (built from source)
Additionally, here is the output of :CocInfo
on my nvim
instance.
2 ## versions
3
4 vim version: NVIM v0.4.0-566-gd5fd0732e
5 node version: v10.15.2
6 coc.nvim version: 0.0.64
7 term: screen-256color
8 platform: linux
9
10 ## Error messages
11
12 ## Output channel: snippets
13
14 ## Output channel: PythonStarting Jedi Python language engine.
15 ##########Linting Output - pylint##########
16 ##########Linting Output - pylint##########
17 ************* Module linreg
18 24,0,error,syntax-error:Format strings are only supported in Python 3.6 and greater (<unknown>, line 24)
19
20
I am setting up a virtual environment with pipenv
(i.e. pipenv shell
) and then starting nvim
within that environment, and I am sure that the python path of this virtual environment is the very first thing on my path at the time I run nvim. (My path starts like this: /home/CanyonTurtle/.local/share/virtualenvs/pythontests-jqiNevtW/bin:/…
Yet, it still selects /usr/bin/python3, and I cannot successfully select anything else. /usr/bin
is also on my path.
@chemzqm thank you for working on this issue. I am glad I found coc-python!
from coc-python.
I agree @ntcong that seems to be the most straightforward. If personal settings need be saved in a .vim
directory and can not be saved elsewhere like to the coc-extensions file in ~/.vim
, and that this is a larger endeavor, I think these choices should be temporarily removed from :CocCommand
until they work as described.
from coc-python.
Related Issues (20)
- yarn install --frozen-lockfile fails HOT 2
- Intellisense low on offers HOT 1
- Cannot disable linting HOT 1
- Wrong Pyright errors. HOT 1
- python.createTerminal not activating virtual env
- iPython as interpreter
- How to make reappear the info of a function
- Why did this happen whenever I opened a python file HOT 1
- "Linter pylint is not installed." Even though it is.
- coc formatter deleting lines when formatting sometimes HOT 1
- Black does not support the "Format Selection" command
- Modified the wrong code, but the underline still exists. HOT 1
- Can't get out of the terminal one interacted with HOT 1
- Uncaught Exception Error on Windows!
- Default ctags exclude list is unconfigurable HOT 1
- Jedi error raised on python completion HOT 2
- Silence [coc.nvim]: Uncaught exception: spawn python2 ENOENT HOT 4
- Autocompletion through Coc vs VS Code HOT 2
- Settings
- Error float window hangs and then not able to get completion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coc-python.