EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20202021  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  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Can't import PyEpics on CentOS 7
From: Matt Newville via Tech-talk <[email protected]>
To: Chiang, Liang-Chih [江良志] <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Wed, 8 Jan 2020 22:22:14 -0600
Hi Liang-Chih, 


On Wed, Jan 8, 2020 at 9:29 PM Chiang, Liang-Chih [江良志] via Tech-talk <[email protected]> wrote:

Hi,


I could install PyEpics on CentOS 6.10(x86_64) and Python 3.7,

and there is no problem using caget, caput, PV, Motor, etc.. of PyEpics.


However, in the following environment, 'import epics' will result in error.

    CentOS version 7.4, x86_64 architecture

    Linux kernel version 3.10.0

    Python 3.7 (created by Miniconda virtual environment)


The PyEpics was installed by the following command:

$ conda install -c GSECARS pyepics


In Python interactive shell:

>>> import epics

Traceback (most recent call last):
  File "/home/user/miniconda3/envs/py37/lib/python3.7/ctypes/__init__.py", line 97, in CFUNCTYPE
    return _c_functype_cache[(restype, argtypes, flags)]
KeyError: (None, (<class 'epics.dbr.access_rights_handler_args'>,), 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/miniconda3/envs/py37/lib/python3.7/site-packages/epics/__init__.py", line 29, in <module>
    from . import ca
  File "/home/user/miniconda3/envs/py37/lib/python3.7/site-packages/epics/ca.py", line 761, in <module>
    dbr.access_rights_handler_args)
  File "/home/user/miniconda3/envs/py37/lib/python3.7/site-packages/epics/dbr.py", line 339, in make_callback
    return ctypes.CFUNCTYPE(None, args)(func)
  File "/home/user/miniconda3/envs/py37/lib/python3.7/ctypes/__init__.py", line 99, in CFUNCTYPE
    class CFunctionType(_CFuncPtr):
TypeError: item 1 in _argtypes_ passes a struct/union with a bitfield by value, which is unsupported.



I also tried installing PyEpics by 'pip install pyepics', similar error message will show up when installing.




Best regards.

 

LiangChih Chiang

email: [email protected]

Beamline Group

National Synchrotron Radiation Research Center (NSRRC)


Sorry for the trouble.    As it turns out, this was raised as an Issue earlier today (see https://github.com/pyepics/pyepics/issues/189).  
The problem is not actually related to CentOS version.   

We've verified that the problem happens with Python 3.7.6, but not with Python 3.7.5.  It also appears that pyepics works with Python 3.8.0.  I don't think anyone has tested it with Python 3.8.1, I suspect that may fail too as it was released at the same time as 3.7.6.   As it happens, it looks like updating an Anaconda Python 3.7 environment will now upgrade to Python 3.7.6. 

We're still tracking down the problem: it looks like our wrapping of the CA `access_rights_handler_args` structure fails with the latest version.  We don't have a proposed solution yet, but some ideas.

I hope we can get this fixed soon.  In the meantime, I think rolling back to Python 3.7.5 is probably the simplest solution.

--Matt Newville

Replies:
Re: Can't import PyEpics on CentOS 7 Matt Newville via Tech-talk
pyepics and python3.8; Was: Can't import PyEpics on CentOS 7 Torsten Bögershausen via Tech-talk
References:
Can't import PyEpics on CentOS 7 Chiang, Liang-Chih [江良志] via Tech-talk

Navigate by Date:
Prev: EPICS Smartmotor example IOC 최원철 via Tech-talk
Next: Re: EPICS release series after 7.0: 7.1 or 8.0? Wang Xiaoqiang via Tech-talk
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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Can't import PyEpics on CentOS 7 Chiang, Liang-Chih [江良志] via Tech-talk
Next: Re: Can't import PyEpics on CentOS 7 Matt Newville via Tech-talk
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  <20202021  2022  2023  2024 
ANJ, 13 Jan 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·