Comments (25)
Run :CocCommand python.setInterpreter
to get current python, it could be not your current python
in $PATH.
from coc-python.
Now I can get completion from jedi by putting "python.pythonPath": "python3",
in my coc-setting. Not sure why because I am on archlinux the default python is already python3. Is coc.nvim
doing something special with conda or python's path?
Strangely enough, the MSLS engine no longer works...
from coc-python.
I see this is old and I stumbled here before as a new python programmer, but I will mention that another reason you can get this error is if jedi is not installed at all. You will need to pip install jedi (or alternate) if nothing else in here is useful.
Yes it's a noob problem, but sometimes you need the noob answer!
from coc-python.
You can use "python.jediPath"
to specify folder of jedi module.
from coc-python.
There's memos that remembers your global choice, you can clean it by rm ~/.config/coc/memos.json
in your shell.
from coc-python.
Is it possible to change the behavior so that it would automatically choose the python based on current $PATH?
It was fixed, checkout version of your coc-python.
from coc-python.
It should use python from your current $PATH unless you have "python.pythonPath"
changed or you used :CocCommand python.setInterpreter
to configure python interpreter for current workspace folder.
Could be issue of wrong workspaceFolder, checkout https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders.
I can't reproduce your problem, you can checkout the log of coc.nvim https://github.com/neoclide/coc.nvim/wiki/Debug-coc.nvim.
from coc-python.
It looks like problem of jedi version.
Checkout log of coc.nvim to get the error https://github.com/neoclide/coc.nvim/wiki/Debug-coc.nvim
from coc-python.
Please write your results here, I'm having trouble with some Jedi versions, too, especially when working on projects involving PyQt5.
from coc-python.
After upgrading the package, the error disappears. But I still cannot get the completion in python. I check the log and I think the key part is
2019-04-25T13:42:02.988 ERROR (pid:5929) [extension-coc-python] - Python Extension: stderr jediProxy, Error (stderr) Traceback (most recent call last):
File "completion.py", line 647, in <module>
2019-04-25T13:42:02.988 ERROR (pid:5929) [extension-coc-python] - Python Extension: stderr jediProxy, Error (stderr) import jedi
ModuleNotFoundError: No module named 'jedi'
The full log is at https://bpaste.net/show/897e03d8fe53.
I can successfully execute import jedi
in system python and vim's python3 import jedi
.
from coc-python.
What is the default behavior when python.jediPath
is empty? I don't want to set it as I sync my configuration file across different machines.
from coc-python.
It's resolved from packages of your current selected python intepreter, checkout :h coc-status
for status line integration.
from coc-python.
I add coc-status to my airline. It is not documented yet:
call airline#parts#define_function('coc_status', 'coc#status')
let g:airline_section_y = airline#section#create_right(['coc_status','ffenc'])
But that seems does not help this. I still do not understand why "python.pythonPath": "python3"
works for me while "python.pythonPath": "python"
yields No module named jedi
. On my computer, I have
$ ls -al `which python3`
lrwxrwxrwx 1 root root 9 Mar 26 14:43 /usr/bin/python3 -> python3.7
$ ls -al `which python`
lrwxrwxrwx 1 root root 7 Mar 26 14:43 /usr/bin/python -> python3
from coc-python.
@zhou13 Because they're different python and they have different site packages.
You can just try import in your command line python.
from coc-python.
But you can see that /usr/bin/python3
really links to /usr/bin/python
...
from coc-python.
from coc-python.
You can see that jedi
imports correctly in python
but it does not work in coc-python.
from coc-python.
It is /home/zyc/.miniconda3/envs/lcnn/bin/python
. Not sure why. Is that because I install coc-python
when I was in that miniconda's virtualenv and for some reason coc-python
hardcodes it?
from coc-python.
@randrej, your problem is probably due to davidhalter/jedi#1236.
from coc-python.
That explains the problem. It seems that coc-python
will always remember the python when it first initializes. After I delete ~/.config/coc/memos.json
, it hardcodes /usr/bin/python
. So if I am inside some virtualenv, it still uses /usr/bin/python
by default. This is a little bit confusing and not convenient. Is it possible to change the behavior so that it would automatically choose the python based on current $PATH
?
from coc-python.
:CocList extensions
tells me that I am at coc-python 1.1.6
. Is that the newest version of coc-python
?
from coc-python.
It only select python interpreter when python inside your workspaceFolder, so if your python outside current workspaceFolder, you have to select the interpreter once for current workspaceFolder.
from coc-python.
@randrej, your problem is probably due to davidhalter/jedi#1236.
Yep, you can see that the last post is mine. It is a jedi problem, so I downgraded jedi (and posted PR #37 to allow using jedi 12.1 with coc-python), which solves my issue for now.
from coc-python.
Use python.jediPath
setting to make sure coc-python load jedi module from that directory.
from coc-python.
It should use python from your current $PATH unless you have
"python.pythonPath"
changed or you used:CocCommand python.setInterpreter
to configure python interpreter for current workspace folder.Could be issue of wrong workspaceFolder, checkout https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders.
I can't reproduce your problem, you can checkout the log of coc.nvim https://github.com/neoclide/coc.nvim/wiki/Debug-coc.nvim.
:CocCommand python.setInterpreter
solve it
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.