Skip to content
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

Fatal Python error: PyThreadState_Get: no current thread #458

Closed
ViViDboarder opened this issue Jul 18, 2013 · 13 comments
Closed

Fatal Python error: PyThreadState_Get: no current thread #458

ViViDboarder opened this issue Jul 18, 2013 · 13 comments

Comments

@ViViDboarder
Copy link

Vim: MacVim Snapshot 68
YouCompleteMe: 2ed9ae7

A bit of the configure log is below

-- The C compiler identification is Clang 4.2.0
-- The CXX compiler identification is Clang 4.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Your C++ compiler supports C++11, compiling in that mode.
-- Found PythonLibs: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python (found suitable version "2.7.5", minimum required is "2.5")
NOT using libclang, no semantic completion for C/C++/ObjC will be available
-- Found PythonInterp: /opt/local/bin/python (found version "2.7.5")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done

In MacVim I get

2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]

Does it require to be compiled with the exact version? The MacVim I'm using was prebuilt, but I suppose I could try to compile it from source as well.

@Valloric
Copy link
Member

And where did you get the error you posted in the issue summary? Also, what were you doing at the time?

@ViViDboarder
Copy link
Author

Got it just starting MacVim. Terminal Vim (that was compiled with MacPorts) works.

@Valloric
Copy link
Member

Are you using the official MacVim binary or something else?

@ViViDboarder
Copy link
Author

Official MacVim binary as downloaded from here: https://code.google.com/p/macvim/downloads/list

@klmr
Copy link

klmr commented Jul 25, 2013

I have the same setup (but using 6f328ea; tried both with MacVim snapshot 66 and snapshot 68) and also get the error – both when invoking MacVim.app or mvim, since updating YCM and recompiling ycm_core (after updating YCM but before recompiling ycm_core Vim still worked).

The exact error I’m getting (right after launching) is

Fatal Python error: PyThreadState_Get: no current thread
Vim: Caught deadly signal ABRT
Vim: Finished.

However, if I’m in a directory containing a .ycm_extra_conf.py file, then before the Vim crash the following dialog box is displayed:

Found /Users/rudolph/Projects/cpp/dna60/.ycm_extra_conf.py. Load?

The editor subsequently crashes regardless of whether I select “OK” or “Cancel”.

Here’s the output from the install.sh script. (long, hence as a Gist rather than inline.)

@Valloric
Copy link
Member

Just tried using the latest MacVim on my OS X Mountain Lion and everything works. So this is somehow caused by your machine configuration in some way, sorry.

@ViViDboarder
Copy link
Author

Any idea what could cause it? Would the fact that the plugin is compiled
with a different version of python have an effect?
On Jul 27, 2013 12:41 PM, "Val Markovic" [email protected] wrote:

Just tried using the latest MacVim on my OS X Mountain Lion and everything
works. So this is somehow caused by your machine configuration in some way,
sorry.


Reply to this email directly or view it on GitHubhttps://github.com//issues/458#issuecomment-21671299
.

@Valloric
Copy link
Member

The version of Python that YCM is linked to when being built and the version of Python linked into your Vim binary have to match, yes. If they don't, a problem like the one you're experiencing might ensue.

@klmr
Copy link

klmr commented Jul 28, 2013

Oh, it would actually be helpful if the install script could warn about this even though it of course makes sense. Is there an easier way of making install.sh use a different Python than modifying the script? It seems that calls to python-config are hard-coded … a --with-python= option might be helpful.

(For now I’m changing it manually; not too bad since the change is restricted to a single line in the script.)

@ViViDboarder
Copy link
Author

Cool. I'll just compile MacVim myself. That should do it. Thanks.
On Jul 28, 2013 2:03 AM, "Konrad Rudolph" [email protected] wrote:

Oh, it would actually be helpful if the install script could warn about
this even though it of course makes sense. Is there an easier way of making
install.sh use a different Python than modifying the script? It seems
that calls to python-config are hard-coded … a --with-python= option
might be helpful.


Reply to this email directly or view it on GitHubhttps://github.com//issues/458#issuecomment-21679428
.

@ViViDboarder
Copy link
Author

Just an FYI to anyone who stumbles on this.

An easy way to get the install command to work with MacVim if you've installed a custom Python binary using MacPorts or something:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/bin:$PATH ./install.sh

That will alter your path for only the install command to make your system look to the standard binaries before your /opt binaries.

So here's the note... This worked and now my precompiled MacVim that I downloaded works perfectly with YCM. However... vim does not because that was compiled with my /opt python binary.

So I'm going to be compiling MacVim myself instead so everything is consistent.

@klmr
Copy link

klmr commented Jul 29, 2013

So I'm going to be compiling MacVim myself instead so everything is consistent.

A hint: don’t. As the YCM readme file says, you should (in almost all cases) use the vim that comes with MacVim.app. This works perfectly. In other words, “copy the mvim script from the MacVim download to your local binary folder (for example /usr/local/bin/mvim) and then symlink it:

ln -s /usr/local/bin/mvim vim

” … and enjoy a command-line vim that’s equivalent in configuration to MacVim, rather than using your own compile, which will be ever so slightly differently configured.

@ViViDboarder
Copy link
Author

That would be much less prone to an error. I installed my system Vim so long ago I can't remember if there was a specific reason why. I guess I'll find out.

bijancn pushed a commit to bijancn/YouCompleteMe that referenced this issue Jul 26, 2016
TypeScript: Add GoToType command

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/458)
<!-- Reviewable:end -->
zdrazil added a commit to zdrazil/my-preferences that referenced this issue Sep 13, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2021
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

3 participants