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: 回覆: Can't import PyEpics on CentOS 7
From: Chiang, Liang-Chih [江良志] via Tech-talk <[email protected]>
To: Matt Newville <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Fri, 10 Jan 2020 00:22:49 +0000

Matt, Thanks for fixing so fast.


I tried and could successfully import PyEpics (version 3.4.1).


I'll start to write Python scripts using PyEpics right away.


Thanks again.


Best regards.

 

LiangChih Chiang

email: [email protected]

Beamline Group

National Synchrotron Radiation Research Center (NSRRC)


寄件者: Matt Newville <[email protected]>
寄件日期: 2020年1月10日 上午 06:04
收件者: Chiang, Liang-Chih [江良志]
副本: [email protected]
主旨: Re: Can't import PyEpics on CentOS 7
 
Hi Liang-Chih, 

This problem is now fixed with pyepics 3.4.1 and you should be able to do 

   `pip install --upgrade pyepics` . or  `conda install -c gsecars pyepics`

to get the latest version.  Note that when mixing install methods, you may have to explicitly delete the 
    <YourPythonEnv>/lib/python3.7/site-packages/epics

to make sure the latest version is used at runtime.  

Let us know if you have any trouble,

--Matt


On Wed, Jan 8, 2020 at 10:22 PM Matt Newville <[email protected]> wrote:
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


--
--Matt Newville <newville at cars.uchicago.edu> 630-252-0431

References:
Can't import PyEpics on CentOS 7 Chiang, Liang-Chih [江良志] via Tech-talk
Re: Can't import PyEpics on CentOS 7 Matt Newville via Tech-talk
Re: Can't import PyEpics on CentOS 7 Matt Newville via Tech-talk

Navigate by Date:
Prev: RE: EPICS release series after 7.0: 7.1 or 8.0? (ABI) Mark Rivers via Tech-talk
Next: New releases of ADPilatus and ADPerkinElmer available Mark Rivers 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: Re: Can't import PyEpics on CentOS 7 Matt Newville via Tech-talk
Next: pyepics and python3.8; Was: Can't import PyEpics on CentOS 7 Torsten Bögershausen 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 ·