You are here

Fatal Python error: PyThreadState_Get: no current thread running "from rosetta import*"

4 posts / 0 new
Last post
Fatal Python error: PyThreadState_Get: no current thread running "from rosetta import*"
#1

I am trying to make PyRosetta run on an iMac with Mountain Lion.
I have Python 2.7 installed from the official installer in /Library/Frameworks/Python.framework/Versions/2.7/bin/python
and IPhyton installed with easy_install in /Library/Frameworks/Python.framework/Versions/2.7/bin/ipython.

Python and IPython work perfectly with other application but when I try PyRosetta something goes wrong and I obtain always the same error:

In [1]: from rosetta import*
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

It should be a problem linked to the PYTHONPATH... is there anyway to make PyRosetta working if PYTHONPAT is not /usr/bin/python?
Have anyone experienced the same problem?

Post Situation: 
Fri, 2013-01-18 10:04
alec

According to http://code.activestate.com/lists/python-list/1806/ that error message indicates a dynamical library loading issue - likely conflicts between the native python and the installed python.

Was there any particular reason you downloaded a separate python2.7 version rather than use the default 2.7 installation that comes with Mountain Lion? Uninstalling the additional python version you have installed would likely fix the problem.

Assuming you're using the regular installs of PyRosetta, and didn't do any special compilation, the library loading should be handled by the regular environment variables. What do the following commands print in your terminal?

echo $PYTHONPATH
echo $LD_LIBRARY_PATH
echo $DYLD_LIBRARY_PATH

Adjusting them may get PyRosetta to work appropriately, although doing so may then break your regular Mac OS programs.

Fri, 2013-01-18 10:56
rmoretti

PyRosetta binaries will work only with build-in 'Apple' python. Please note that it does not mean that you have to make it system default, just make sure to start PyRosetta with /usr/bin/python. So if you want you can maintain alternative shell setting for different Python versions and use them when you need to run PyRosetta. If you decided to go this way I would recommend to use http://pypi.python.org/pypi/virtualenv package to maintain different python env.

Also, if for some reason you absolutely need to use other version of python (say if you have other packages which you want to use in conjunction with PyRosetta) then the only option will be to recompile PyRosetta and link against your custom Python version.

Fri, 2013-01-18 12:30
Sergey

I see, it is clear now.
I was thinking that it was a PYTHONPATH problem and I was wondering if it could be solved in an easy way by changing the links in PyRosetta without recompiling. I guess I will just go on with the preinstalled Apple Python. I will try it and let you know.

Thanks for the explanation!

Sat, 2013-01-19 07:30
alec