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>
Reply-To: "Juan F. Esteban Müller" <JuanF.EstebanMuller at ess.eu>
Date: Tuesday, 18 August 2020 at 11:18
To: "Cobb, Tom (DLSLtd,RAL,LSCI) via Tech-talk" <tech-talk at aps.anl.gov>
Subject: EPICS7 and Python
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