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

conda environment for 2025_1 #334

Merged
merged 5 commits into from
Jan 24, 2025
Merged

conda environment for 2025_1 #334

merged 5 commits into from
Jan 24, 2025

Conversation

prjemian
Copy link
Contributor

@prjemian prjemian added the task routine work label Jan 21, 2025
@prjemian prjemian added this to the v1.0.5 milestone Jan 21, 2025
@prjemian prjemian self-assigned this Jan 21, 2025
@prjemian
Copy link
Contributor Author

@coveralls
Copy link

coveralls commented Jan 21, 2025

Pull Request Test Coverage Report for Build 12958363196

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 83.197%

Totals Coverage Status
Change from base Build 12170875078: 0.0%
Covered Lines: 1020
Relevant Lines: 1226

💛 - Coveralls

@prjemian prjemian requested a review from a team January 21, 2025 21:28
@prjemian
Copy link
Contributor Author

To be merged 2025-01-24 unless there are objections.

@prjemian
Copy link
Contributor Author

Trouble with import ophyd:

ChannelAccessException: loading Epics CA DLL failed: libncurses.so.5: cannot open shared object file: No such file or directory
(bluesky_2025_1) jemian@otz ~/bluesky $ ipython
Python 3.11.11 | packaged by conda-forge | (main, Dec  5 2024, 14:17:24) [GCC 13.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.31.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import ophyd
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
File ~/.conda/envs/bluesky_2025_1/lib/python3.11/site-packages/epics/ca.py:383, in initialize_libca()
    381     if os.name == 'nt':
    382         load_dll(find_libCom())
--> 383     libca = load_dll(find_libca())
    384 except Exception as exc:
    385     raise ChannelAccessException('loading Epics CA DLL failed: ' + str(exc))

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/ctypes/__init__.py:454, in LibraryLoader.LoadLibrary(self, name)
    453 def LoadLibrary(self, name):
--> 454     return self._dlltype(name)

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/ctypes/__init__.py:376, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    373 self._FuncPtr = _FuncPtr
    375 if handle is None:
--> 376     self._handle = _dlopen(self._name, mode)
    377 else:
    378     self._handle = handle

OSError: libncurses.so.5: cannot open shared object file: No such file or directory
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
File ~/.conda/envs/bluesky_2025_1/lib/python3.11/site-packages/epics/ca.py:383, in initialize_libca()
    382         load_dll(find_libCom())
--> 383     libca = load_dll(find_libca())
    384 except Exception as exc:

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/ctypes/__init__.py:454, in LibraryLoader.LoadLibrary(self, name)
    453 def LoadLibrary(self, name):
--> 454     return self._dlltype(name)

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/ctypes/__init__.py:376, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    375 if handle is None:
--> 376     self._handle = _dlopen(self._name, mode)
    377 else:

OSError: libncurses.so.5: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

ChannelAccessException                    Traceback (most recent call last)
Cell In[1], line 1
----> 1 import ophyd

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/site-packages/ophyd/__init__.py:89
     85         raise RuntimeError("control layer not set, " "unsure how you got to this state")
     86     return cl
---> 89 set_cl()
     91 # Areadetector-related
     92 from .areadetector import *  # noqa: F401, F402, E402, F403

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/site-packages/ophyd/__init__.py:24, in set_cl(control_layer, pv_telemetry)
     22 for c_type in known_layers:
     23     try:
---> 24         set_cl(c_type, pv_telemetry=pv_telemetry)
     25     except ImportError:
     26         continue

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/site-packages/ophyd/__init__.py:51, in set_cl(control_layer, pv_telemetry)
     48 else:
     49     raise ValueError("unknown control_layer")
---> 51 shim.setup(logger)
     53 exports = (
     54     "setup",
     55     "caput",
   (...)
     61     "get_dispatcher",
     62 )
     63 # this sets the module level value

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/site-packages/ophyd/_pyepics_shim.py:203, in setup(logger)
    199     _dispatcher = None
    201 logger.debug("Installing event dispatcher")
    202 _dispatcher = EventDispatcher(
--> 203     thread_class=PyepicsCallbackThread, context=ca.current_context(), logger=logger
    204 )
    205 atexit.register(_cleanup)
    206 return _dispatcher

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/site-packages/epics/ca.py:596, in withCA.<locals>.wrapper(*args, **kwds)
    594 global libca
    595 if libca is None:
--> 596     initialize_libca()
    597 elif libca is _LIBCA_FINALIZED:
    598     return  # Avoid raising exceptions when Python shutting down

File ~/.conda/envs/bluesky_2025_1/lib/python3.11/site-packages/epics/ca.py:385, in initialize_libca()
    383     libca = load_dll(find_libca())
    384 except Exception as exc:
--> 385     raise ChannelAccessException('loading Epics CA DLL failed: ' + str(exc))
    387 ca_context = {False:0, True:1}[PREEMPTIVE_CALLBACK]
    388 ret = libca.ca_context_create(ca_context)

ChannelAccessException: loading Epics CA DLL failed: libncurses.so.5: cannot open shared object file: No such file or directory

@prjemian
Copy link
Contributor Author

With these changes, import ophyd passes. Also, ophyd objects work as expected.

@prjemian
Copy link
Contributor Author

@tacaswell raised a good point on Bluesky's Mattermost discussion:

I strongly suggest you prefer conda packages over wheels. See https://pypackaging-native.github.io/ for a long discussion of the technical (and social) issues with the wheel packaging ecosystem

@prjemian prjemian merged commit de1b8bb into main Jan 24, 2025
5 checks passed
@prjemian prjemian deleted the 333-env-2025_1 branch January 24, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task routine work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

conda environment for 2025_1
2 participants