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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: EPICS7 and Python |
From: | "Cobb, Tom \(DLSLtd,RAL,LSCI\) via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "Cobb, Tom (DLSLtd,RAL,LSCI) via Tech-talk" <tech-talk at aps.anl.gov>, Juan F. Esteban Müller <JuanF.EstebanMuller at ess.eu> |
Date: | Tue, 18 Aug 2020 14:56:06 +0000 |
Hi Juan,
Did you install p4p using pip, or as an EPICS module from source?
If you installed via pip, what version of epicscorelibs did it pull in?
Personally, I always install it with pip, and it pulls in a version of epicscorelibs with a matching version of epics base bundled in it. I'm not sure what happens if you try to then load a different version of epics base into the same Python process,
I imagine you might get odd issues like you have seen.
My suggestion would be to make pyepics use the bundled version of epics base as suggested here:
Thanks,
Tom
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Juan F. Esteban Müller via Tech-talk <tech-talk at aps.anl.gov>
Sent: 18 August 2020 13:39 To: Cobb, Tom (DLSLtd,RAL,LSCI) via Tech-talk <tech-talk at aps.anl.gov> Subject: Re: EPICS7 and Python Hi again,
It seems that if I create a CA context before importing the p4p client, it all works fine. It is still a mystery for me, but it seems to be a good workaround for the moment.
import epics epics.ca.create_context() import p4p.client.thread
Cheers, Juan
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of "Juan F. Esteban Müller via Tech-talk" <tech-talk at aps.anl.gov>
Hi all,
I have been using CA and PVA clients in Python for some time, but in the last few days I started to have issues. I recently updated to macos Catalina and python 3.7.7, and I am using epics base 7.0.4.
I wrote a small script to reproduce my issues: import time from __future__ import print_function import epics import p4p.client.thread
pv = epics.PV('SOME:PV', connection_callback=lambda pvname,conn,pv: print('connected')) time.sleep(1) pv.connect(timeout=0) pv.get()
This script fails to connect to the PV if I run it on python 3.7.7, using pyepics 3.4.2 with PYEPICS_LIBCA pointing to epics base 7.0.4, and p4p 3.5.1. Even trying to stop the python interpreter with ctrl-C doesn’t work, I have to kill the process. Removing the p4p import fixes the issue. I tried different EPICS7 releases and all fail, while EPICSv3 seems to work just fine. Unsetting PYEPICS_LIBCA also works, because the internal ca lib is 3.16. It also runs fine on python 2.7, with and without PYEPICS_LIBCA pointing to epics base 7.
Any clue where the issue might be? Thanks!
Best regards, Juan
-- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. |