1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: PyEPICS timeout in jupyter |
From: | "Shen, Guobao" <[email protected]> |
To: | Matt Newville <[email protected]> |
Cc: | Talk EPICS Tech <[email protected]> |
Date: | Tue, 15 May 2018 16:36:20 +0000 |
Hi Matt, Yes, the outputs are same from both terminal & jupyter. I am wondering something wrong with Mac or safari. I had no problem with the same script on my linux box. Here is output from my terminal: >>> print(epics.ca.find_libca()) /Users/xxxxxx/anaconda3/anaconda3/lib/python3.6/site-packages/epics/clibs/darwin64/libca.dylib >>> chan = epics.ca.create_channel('test') >>> conn = epics.ca.connect_channel(chan) >>> print("Connected ", chan, conn== epics.dbr.CS_CONN) Connected c_long(140696518603264) False >>> val = epics.ca.get(chan) >>> print(val) 5.6 And output from jupyter notebook: print(epics.ca.find_libca()) chan = epics.ca.create_channel('test') conn = epics.ca.connect_channel(chan) print("Connected ", chan, conn== epics.dbr.CS_CONN) val = epics.ca.get(chan)
/Users/xxxxxx/anaconda3/anaconda3/lib/python3.6/site-packages/epics/clibs/darwin64/libca.dylib
Connected 140535502249016 False /Users/xxxxxx/anaconda3/anaconda3/lib/python3.6/site-packages/epics/ca.py:1306: UserWarning: ca.get('test') timed out after 1.00 seconds.
warnings.warn(msg % (name(chid), timeout))
Thanks, Guobao From: <[email protected]> on behalf of Matt Newville <[email protected]> On Tue, May 15, 2018 at 10:36 AM, Shen, Guobao <[email protected]>
wrote:
Hm, maybe. Perhaps the Jupyter kernel has different environmental variables set for how it finds the CA shared library, and how it searches for PVs?
print(epics.ca.find_libca()) gives the same libca as when running python from the Terminal? Second, if you do import epics chan = epics.ca.create_channel('test') print("Connected ", chan, conn== epics.dbr.CS_CONN) val = epics.ca.get(chan) do you really see that the channel is connected? Do you get the same results from running python in the Terminal?
I'm not sure. It may be that cothread does not always do `ca_array_get_callback()` and then expect that the callback will be called. I don't know why that would cause a problem from Jupyter
for you. --Matt Newville
|