SFRAME - PYTHON PROBLEM: Failed to send message: Context was terminated

User 4014 | 3/25/2016, 4:15:57 PM

Hi,

I'm a student and I've installed SFrame open source following the guide available online . Then I opened the python environment and I've imported the sframe library.

I've imported a csv file and I've found some problems, with the same errors which forces me to close the python session.: The error is repeated continuously on the screen

Failed to send message: Context was terminated Failed to send message: Context was terminated Failed to send message: Context was terminated

To better explain my question, I use an example of sframe:

case 1: load data with COLUMN_NAMES and type defined

songs sframe.SFrame.readcsv = ('~/ songdata.csv',                                   columntypehints = {"songid" str, "title": str, "release": str, "artistname": str, "year": int},                                   na_values = ["NA"], nrows = 1000000)

case 2: Suppose we want to add a column of the number of times the word 'love' is used in the title and artist column:

songs ['love_count'] = songs [['title', 'artist_name']]. apply (      lambda row: sum (x.lower (). split ('') .count ('love') for x in row.values ()))

May you help me figure out the problem/error? Thanks in advance

Comments

User 1178 | 3/29/2016, 6:25:02 PM

Hi,

Can you tell us a little more information regarding your environment and the version of SFrame you are installing?

  1. Which OS and version are you using?
  2. Which version of SFrame are you installing?
  3. Did you happen to import other modules before you import SFrame?
  4. Which Python environment are you using? Are you using Anaconda, VirtualEnv or system installed Python? We usually see problems if you use system Python and we recommend using Anaconda as your Python environment manager.
  5. Usually there is a log file generated as part of the SFrame start. Do you mind sharing with us the log file? The file name is printed at beginning when you import the SFrame.

Thanks!

Ping


User 4244 | 3/31/2016, 6:34:49 PM

I have having the same problem, but I am trying to load an SFrame from a ".gl/" folder.

import sframe as sf
loans = sf.SFrame('lending-club-data.gl/')

1) Mac OS X El Capitan

2) SFrame 1.8.5

3) No

4) I installed Python 2.7 directly from the python website

5) This is an endless loop that I cut off:

>>> import sframe as sf
>>> loans = sf.SFrame('lending-club-data.gl/')
2016-03-31 11:29:07,258 [INFO] sframe.cython.cy_server, 172: SFrame v1.8.5 started. Logging /tmp/sframe_server_1459448947.log
2016-03-31 11:29:07,501 [INFO] sframe.cython.cy_server, 172: SFrame v1.8.5 started. Logging /tmp/sframe_server_1459448947.log
>>> Failed to send message: Context was terminated
Failed to send message: Context was terminated
Failed to send message: Context was terminated
Failed to send message: Context was terminated
Failed to send message: Context was terminated
Failed to send message: Context was terminated

User 1178 | 3/31/2016, 9:22:55 PM

Hi,

It is often tricky to setup Python environment to work properly, especially in Mac and Windows. We recommend use Conda as your Python environment manager and it tends to be less problematic.

Do you mind using Conda environment and see if it solves your problem? You may download and install miniconda from here:

http://conda.pydata.org/miniconda.html

Or Conda with a lot of scientific packages pre-setup here:

https://www.continuum.io/downloads

After installation, you may create an Python25 environment for using SFrame by:

conda create -n sframe-1.8.5 python=2.7
source activate sframe-1.8.5
pip install sframe==1.8.5

That should resolve your issue.

Thanks! Ping


User 5225 | 5/25/2016, 1:36:55 AM

Ping,

I ran into the same situation. I followed your instruction about creating Python25 environment for using SFrame. The problem is can I import graphlab into it? (I used to use dato env for that). It seems to me I need two different environment to use both of those things (SFrame and GraphLab).

I apologize if I am missing a big picture here, I am quite new to Python and not too familiar with env facility. (I have been using MATLAB all throughout).

Thank you for your help.

K


User 5303 | 6/18/2016, 9:52:50 AM

Hi Ping,

I installed conda as explained above but still get same issue. Is there any know way to fix this?

Regards Mohammad


User 940 | 6/20/2016, 6:18:31 PM

Hi @Mohammed,

Which version of SFrame are you installing? Could you try not specifying a version number to get the latest?

Cheers! -Piotr


User 940 | 6/20/2016, 6:51:58 PM

@"Kaushal Shah" ,

Sorry for the delayed response, but the two packages are mutually exclusive. I believe that you can have them both installed in the same environment, but cannot import both of them at the same time in the same process.

Cheers! -Piotr


User 5303 | 6/21/2016, 3:27:54 AM

Hi Piotr

Thanks a lot for your response. I tried 1.8.5 and 1.10 on OSX 10.11.5 with Python 2.7.10 and 2.7.11

There is one thing that I have noticed. Loading data in SFrame or creating new SFrame from python interactive shell sometimes works(usually first-time fails but second time onwards works). But it always fails when I try loading it in ipython notebook or in a python script.

Regards Mohammad

@piotr


User 940 | 6/21/2016, 5:57:22 PM

Hi @Mohammad ,

This is odd. Could you give a reproducible code snippet? This would help us debug.

Cheers! -Piotr


User 5303 | 6/22/2016, 5:06:28 AM

Hello Piotr Thanks for your response again. Following is code I am writing in test.py file.

import sframe

products = sframe.SFrame()
print products

When I run the file execution pauses with the following line in console

[INFO] sframe.cython.cy_server: SFrame v1.10 started. Logging /tmp/sframe_server_1466571097.log

Following is log being written in file

[~]$ tail -f /tmp/sframe_server_1466571097.log 1466571097 : INFO: (normalize_address:175): normalize_address: kept 'inproc://sframe_server'. 1466571097 : INFO: (convert_generic_address_to_specific:218): Possibly converting inproc://sframe_server_control 1466571098 : INFO: (convert_generic_address_to_specific:218): Possibly converting inproc://sframe_server_status 1466571098 : INFO: (normalize_address:175): normalize_address: kept 'inproc://sframe_server_status'. 1466571098 : INFO: (stop_server:45): Stopping server 1466571098 : INFO: (~comm_server:200): Function entry 1466571098 : INFO: (stop:227): Function entry 1466571098 : INFO: (normalize_address:175): normalize_address: kept 'inproc://sframe_server_control'. 1466571098 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571104 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571110 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571116 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571122 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571128 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571134 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571140 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571146 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571152 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571158 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571164 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571171 : ERROR: (send_to_target:354): Failed to send message: Context was terminated 1466571177 : ERROR: (send_to_target:354): Failed to send message: Context was terminated

Next step:

I try running exactly same code in python interactive shell. It pauses execution first time with a similer line in the terminal. So, I press Ctrl+C to stop execution and repeat the same process second time.

Please check attached image for whole flow of execution.

@piotr

Regards Mohammad


User 940 | 6/22/2016, 8:01:07 PM

Hi @Mohammad ,

This is a bit odd. We're trying to repro and and will keep you posted.

Cheers! -Piotr


User 5303 | 6/23/2016, 10:36:43 AM

Hi @piotr

Thanks for helping...

I have attached the log file, in case it helps in debugging. By the way, is there any guide available to do development environment setup on MAC?

I have cloned following repository. https://github.com/dato-code/SFrame

I can take a look myself if I can do development environment setup

Regards Mohammad


User 940 | 6/23/2016, 6:59:00 PM

Hi @Mohammed,

We're still looking into this. The README of the repo should talk about how to set up dev environment.

Cheers! -Piotr


User 5303 | 6/24/2016, 2:47:15 PM

Hello @piotr

There is a small update from my side. I tried compiling code for SFrame 1.9. Compiled code works properly.

So, probably something wrong with the environment or python setup.

Regards Mohammad


User 940 | 6/24/2016, 8:13:41 PM

Hi @Mohammed,

This is a good update. Out of curiosity, did compiling SFrame 1.10 work as well?

Cheers! -Piotr