Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with pyepics finding libca #46

Open
tacaswell opened this issue Nov 22, 2021 · 3 comments
Open

Issues with pyepics finding libca #46

tacaswell opened this issue Nov 22, 2021 · 3 comments

Comments

@tacaswell
Copy link

With a 2021-1.2 environment

[tcaswell@xf28id2-srv1 ~]$ conda activate /opt/bluesky/qserver/conda_envs/qserver-collection-2021-1.2/(/opt/bluesky/qserver/conda_envs/qserver-collection-2021-1.2) [tcaswell@xf28id2-srv1 ~]$ conda list | grep -i epic
epics-base                7.0.4                h68659b9_0    nsls2forge
pyepics                   3.4.3                    py37_0    nsls2forge

Trying to import pyepics will eventually fail with:

(/opt/bluesky/qserver/conda_envs/qserver-collection-2021-1.2) [tcaswell@xf28id2-srv1 ~]$ ipython
impPython 3.7.7 (default, Mar 26 2020, 15:48:22) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.21.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import epics.ca

In [2]: epics.ca.find_libca()
---------------------------------------------------------------------------
ChannelAccessException                    Traceback (most recent call last)
<ipython-input-2-476db334b910> in <module>
----> 1 epics.ca.find_libca()

/opt/bluesky/qserver/conda_envs/qserver-collection-2021-1.2/lib/python3.7/site-packages/epics/ca.py in find_libca()
    331 
    332 def find_libca():
--> 333     return _find_lib('ca')
    334 
    335 def find_libCom():

/opt/bluesky/qserver/conda_envs/qserver-collection-2021-1.2/lib/python3.7/site-packages/epics/ca.py in _find_lib(inp_lib_name)
    327         return dllpath
    328 
--> 329     raise ChannelAccessException('cannot find Epics CA DLL')
    330 
    331 

ChannelAccessException: cannot find Epics CA DLL

Debugging this, the search path for pyepics ad-hoc library search path does not include where the epics libraries actually are (the underlying bug here is that pyepics re-implements library discovery but unfortunately that is not actually fixable upstream). A work-around is to do

export PYEPICS_LIBCA=/opt/bluesky/qserver/conda_envs/qserver-collection-2021-1.2/epics/lib/linux-x86_64/libca.so

before starting IPython, but this is obviously not a generalizable solution.

It is possible that this will need to be addressed in the CF builds of either pyepics or epics-base.

@mrakitin
Copy link
Collaborator

Thanks for the report, @tacaswell! Is it reproducible on newer conda envs, such as 2021-3.0?

I also wonder if the "DLL" is Windows slang, but I assume it was meant to be "shared object" libraries.

@tacaswell
Copy link
Author

Yeah, the error message is from pyepic's home-grown search logic and has a windows-specific accent.

@mrakitin
Copy link
Collaborator

@tacaswell, do you have a solution for that? I don't think I observed any issues on the floor with the new conda env...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants