-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jedi-vim failed to initialize Python: ":py/py3 import jedi" gives "ImportError: cannot import name 'settings'" #526
Comments
This is very strange. Could you reinstall Jedi? It looks like there's something missing. |
I have uninstalled and re-installed jedi. I checked and there is a settings.py file in the jedi install directory. Ran
|
Also, I can |
I have no idea... It doesn't make any sense. It's definitely not a jedi-vim issue, because you cannot import it directly either. Did you also check if the |
I'm getting a similar error.
From what I can see, the issue seems to happen when
Uninstalling |
Is this on vim or neovim? My bug in #523 is happening and may be neovim-specific. |
The initial report is with Vim. @MadWombat |
Oh, you've posted this already.. Seems to be the same issue as #530 then. |
What is the output of |
I cannot do :py import jedi since I don't have python 2 support compiled in. I have posted the py3 equivalent earlier. |
@MadWombat |
See this comment |
Probably |
Isn't that where the actual jedi-vim module imports things from? Besides, I didn't put it there. |
Yes, that's related to the issue then probably:
I only have The other one should be popped/removed in Line 22 in 625c568
But also when commenting this line I cannot reproduce the issue. |
Is everybody with the issue using Mac OS El Captain? |
I do. Not sure about everyone else. |
#447 mentions that it's fixed by removing/disabling python-mode - might be worth a try. |
Ehm... but that kinda defeats the purpose. Python-mode has a lot of features I am using. If that is the solution, I would rather disable jedi-vim :) |
Please try to reproduce it in the Python interpreter by replicating the |
That worked just fine. I did
and that didn't cause any errors |
@blueyed: Yep on el Capitan (10.11.3); python 2.7 in my case. Exact sad is:
When I run Everything was copacetic until I did the el Capitan upgrade (also upgraded from vim 7.3 to 7.3, sorry for the extra variable.) sigh. Things that haven't worked:
|
Yup, you can check #530, which was merged into this issue. The error is:
|
I might have duplicated / merged too much into this issue, but it should now be only about See #522 for the issue with colorama 0.3.6. |
@MikeDacre Can we say that this issue is specific to Mac OS and homebrew there? |
Didn't someone just recently report having this problem with native python? |
I'm not sure, I would say a lot got confused with the error from colorama 0.3.6. Maybe it's even related to this one somehow - both kept popping up at the same time (at least it seems so for me). |
I could imagine something is messing with the import system (and some error there is silenced), and you only get a non-related error. |
When you try to import
Uninstalling |
Unfortunately I have the same error and I do not use colorama. I think there are two separate related issues here. |
Uninstalling colorama worked for me. But several packages I use need colorama, so I have to install it back. Any other solution? |
The colorama issue is #522. The workaround is to use 0.3.5. I have submitted a PR to fix it, but it is nor merged yet. Feedback would be appreciated there. |
OK, this issue just started happening on my linux box too:
No idea why, I did not change my config at all, just like with my Mac. I did do a system upgrade though. Following the system upgrade, this error started happening. Very similar to with my Mac. Really bizarre. Updating all plugins has no effect, disabling all plugins except jedi-vim has no effect, removing all jedi config lines from my vimrc (going back to default config), has no effect. It is just bust. This may be a slightly different issue though (probably not), because it seems like arch linux has changed the default vim compilation to include both python2 and 3, dynamically linked:
Compiling vim myself with only python2 fixes the issue in this case. There is a slightly different sys.path issue for the python2/3 default vim in arch linux now:
I realize that in both cases, on Mac OS and on the new arch linux vim, this problem isn't technically the fault of jedi-vim, as it works OK on other platforms, but at the same time I wonder if it is possible to improve the sys.path handling to ensure that in every case, |
OK, in this case, I can fix the issue by forcing python2 with let g:jedi#force_py_version = 2. If left to default with both pythons compiled in, python3 is used, and then the above error happens. Is this a known issue with python2/3 compilation? I am debating whether this is related to the primary issue of this thread. It is that same kind of thing, jed#setup_py_version() fails at line 18 because of sys.path problems, but in this case the trigger and sys.path problem is different. If you think this is off topic I will delete these comments and open a new issue. |
Hmm. So what then adds to the sys path? VIM itself? |
Putting in my obersrvations: For me, the issue occured after I updated pylint. That installed colorama. Post pylint update, I started getting the above error. Uninstalled and reinstalled jedi. No avail. Did a pip uninstall of colorama and things went back to normal. |
@saurabh-hirani This issue is about @MikeDacre |
@blueyed Ah ok - my bad. |
same problem on Debian Sid, vim compiled from git master.
:py3 import jedi yields:
Downgrading python3-colorama from 0.3.6-1 to 0.3.3-1 solves problem. |
upgrading colorama from 0.3.6 to 0.3.7 solves this problem |
I have colorama 0.3.3 in the virtualenv. However jedi seemed to care more about the colorama in my Upgrading to 0.3.7 fixed. Just like @Congee |
I have the similar error. My system is MacOS 10.12.3. It works well when I import Jedi in python... `#### Jedi-vim debug information
|
Sounds like a messed-up Python installation/virtualenv. |
Weird it happened to me today, my Python is 3.7 |
@dendisuhubdy I also had this issue happen when I upgraded via brew to python 3.7 |
Please refer to this comment #841 (comment) I'm pretty sure it's an issue on brew with 3.7. |
I get the following error every time I start VIM
I am running on Mac OS X El Captain 10.11.2. Vim is version 7.4.1063, python is version 3.4.3. Jedi is 0.9.0. Both python and vim are installed using brew, vim is installed using --with-python3 flag. :py3 command works, but trying to do :py3 import jedi results in the following
I tried reinstalling everything and re-installing vim with
env vi_cv_path_python=/usr/local/bin/python3 brew install --force vim --with-python3
command as was suggested in a similar issue.Here is :version output for more info.
The text was updated successfully, but these errors were encountered: