PyThreadState_Get: no current thread

85 views
Skip to first unread message

Melanie Allen

unread,
Jul 14, 2015, 8:07:58 PM7/14/15
to caffe...@googlegroups.com

I am running Mac OSX 10.10.4. 

I followed the installing caffe the right way tutorial. http://installing-caffe-the-right-way.wikidot.com/

I understand that this error means I have conflicting pythons... but I can't find any evidence

Whether I run python or ipython, I am getting the following error:

In [1]: import caffe

Fatal Python error: PyThreadState_Get: no current thread

Abort trap: 6


BelowI display everything that I think relates to the problem... Did I miss something? Is there a failsafe method I don't know about?

My .bash_profile:

export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH

export PYTHONPATH=/Users/bemorgan/caffe/python/:$PYTHONPATH

export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/cuda/lib/:$DYLD_FALLBACK_LIBRARY_PATH


My make.config Python references:

# NOTE: this is required only if you will compile the python interface.

# We need to be able to find Python.h and numpy/arrayobject.h.

PYTHON_INCLUDE := /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/include/python2.7

# Anaconda Python distribution is quite popular. Include path:

# Verify anaconda location, sometimes it's in root.

#ANACONDA_HOME := $(HOME)/anaconda

#PYTHON_INCLUDE := $(ANACONDA_HOME)/include \

# $(ANACONDA_HOME)/include/python2.7.10_1 \

# $(ANACONDA_HOME)/lib/python2.7.10_1/site-packages/numpy/core/include \


# We need to be able to find libpythonX.X.so or .dylib.

#PYTHON_LIB := /usr/lib

PYTHON_LIB := /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/


# Homebrew installs numpy in a non standard path (keg only)

 PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include

 PYTHON_LIB += $(shell brew --prefix numpy)/lib


# Uncomment to support layers written in Python (will link against Python libs)

# WITH_PYTHON_LAYER := 1


# Whatever else you find you need goes here.

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib 



Output of  python -v:

# installing zipimport hook

import zipimport # builtin

# installed zipimport hook

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py

import site # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py

import os # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc

import errno # builtin

import posix # builtin

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py

import posixpath # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.py

import stat # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py

import genericpath # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.py

import warnings # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py

import linecache # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py

import types # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py

import UserDict # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py

import _abcoll # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py

import abc # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py

import _weakrefset # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc

import _weakref # builtin

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.py

import copy_reg # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py

import traceback # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py

import sysconfig # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py

import re # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.py

import sre_compile # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.pyc

import _sre # builtin

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.py

import sre_parse # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.py

import sre_constants # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.pyc

dlopen("/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so", 2);

import _locale # dynamically loaded from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py

import _sysconfigdata # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.py

import _osx_support # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.pyc

# /usr/local/lib/python2.7/site-packages/sitecustomize.pyc matches /usr/local/lib/python2.7/site-packages/sitecustomize.py

import sitecustomize # precompiled from /usr/local/lib/python2.7/site-packages/sitecustomize.pyc

import encodings # directory /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.py

import encodings # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py

import codecs # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.pyc

import _codecs # builtin

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.py

import encodings.aliases # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.pyc

# /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.pyc matches /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py

import encodings.utf_8 # precompiled from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.pyc

Python 2.7.10 (default, Jul  9 2015, 13:34:07) 

[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

dlopen("/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so", 2);

import readline # dynamically loaded from /usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so

>>> 

Thank you!

ageweile

unread,
Jul 16, 2015, 7:58:46 AM7/16/15
to caffe...@googlegroups.com
Hi. I hat the same problem. This error occurs when your installed dependecies uses different python version. I fixed this error by installing anaconda python and reinstalled all dependecies with homebrew. If you will do the same what means installing anaconda-python, you have to edit your Make.config file

I recommend you following website: how-to-install-caffe-on-mac-os-x-10-10
Reply all
Reply to author
Forward
0 new messages