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

Having Pixi available but not in use in the current project breaks Ambertools #101

Open
Yoshanuikabundi opened this issue Jan 30, 2025 · 5 comments

Comments

@Yoshanuikabundi
Copy link

Attempting to import the Toolkit when Ambertools is installed and the pixi binary is available, but not in use on the current project leads to an error:

Error:
  × could not find pixi.toml or pyproject.toml which is configured to use pixi

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
File ~/Documents/openff/openff-pablo/openff/pablo/_tests/data/prepared_pdbs/ions.py:1
----> 1 from openff.toolkit import Molecule, Topology
      2 from openff.units import unit
      4 from openff.interchange.components._packmol import pack_box

File <frozen importlib._bootstrap>:1231, in _handle_fromlist(module, fromlist, import_, recursive)

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/toolkit/__init__.py:80, in __getattr__(name)
     78 obj_mod = _lazy_imports_obj.get(name)
     79 if obj_mod is not None:
---> 80     mod = importlib.import_module(obj_mod)
     81     # This only causes an infinite recursive loop if an object that does not
     82     # exist is declared in `_lazy_imports_obj` to be lazy loaded from the
     83     # current module. Since there is no reason to include either an object
     84     # from the current module or an object that does not exist in
     85     # `_lazy_imports_obj`, and since the function would fail in this case
     86     # anyway, this is safe.
     87     return getattr(mod, name)

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/importlib/__init__.py:126, in import_module(name, package)
    124             break
    125         level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/toolkit/topology/__init__.py:1
----> 1 from openff.toolkit.topology.molecule import (
      2     Atom,
      3     Bond,
      4     FrozenMolecule,
      5     HierarchyElement,
      6     HierarchyScheme,
      7     Molecule,
      8     Particle,
      9 )
     10 from openff.toolkit.topology.topology import (
     11     DuplicateUniqueMoleculeError,
     12     ImproperDict,
   (...)
     21     ValenceDict,
     22 )
     24 __all__ = [
     25     "Atom",
     26     "Bond",
   (...)
     42     "ValenceDict",
     43 ]

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/toolkit/topology/molecule.py:54
     51 from typing_extensions import TypeAlias
     53 from openff.toolkit import Quantity, unit
---> 54 from openff.toolkit.utils.constants import DEFAULT_AROMATICITY_MODEL
     55 from openff.toolkit.utils.exceptions import (
     56     AtomMappingWarning,
     57     BondExistsError,
   (...)
     75     UnsupportedFileTypeError,
     76 )
     77 from openff.toolkit.utils.serialization import Serializable

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/toolkit/utils/__init__.py:10
      1 from openff.toolkit.utils.constants import (
      2     ALLOWED_AROMATICITY_MODELS,
      3     ALLOWED_CHARGE_MODELS,
   (...)
      7     DEFAULT_FRACTIONAL_BOND_ORDER_MODEL,
      8 )
      9 from openff.toolkit.utils.toolkit_registry import toolkit_registry_manager
---> 10 from openff.toolkit.utils.toolkits import (
     11     AMBERTOOLS_AVAILABLE,
     12     BASIC_CHEMINFORMATICS_TOOLKITS,
     13     GLOBAL_TOOLKIT_REGISTRY,
     14     OPENEYE_AVAILABLE,
     15     RDKIT_AVAILABLE,
     16     AmberToolsToolkitWrapper,
     17     AntechamberNotFoundError,
     18     BuiltInToolkitWrapper,
     19     ChargeCalculationError,
     20     ChargeMethodUnavailableError,
     21     GAFFAtomTypeWarning,
     22     IncompatibleUnitError,
     23     IncorrectNumConformersError,
     24     IncorrectNumConformersWarning,
     25     InvalidIUPACNameError,
     26     InvalidToolkitError,
     27     InvalidToolkitRegistryError,
     28     LicenseError,
     29     MissingPackageError,
     30     OpenEyeToolkitWrapper,
     31     RDKitToolkitWrapper,
     32     SMILESParseError,
     33     ToolkitRegistry,
     34     ToolkitUnavailableException,
     35     ToolkitWrapper,
     36     UndefinedStereochemistryError,
     37 )
     38 from openff.toolkit.utils.utils import (
     39     all_subclasses,
     40     convert_0_1_smirnoff_to_0_2,
   (...)
     55     unit_to_string,
     56 )

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/toolkit/utils/toolkits.py:102
     98 logger = logging.getLogger(__name__)
    101 # Create global toolkit registry, where all available toolkits are registered
--> 102 GLOBAL_TOOLKIT_REGISTRY = ToolkitRegistry(
    103     toolkit_precedence=[
    104         OpenEyeToolkitWrapper,
    105         RDKitToolkitWrapper,
    106         AmberToolsToolkitWrapper,
    107         BuiltInToolkitWrapper,
    108     ],
    109     exception_if_unavailable=False,
    110 )
    111 """
    112 The toolkit registry used by default when no registry or wrapper is specified.
    113
   (...)
    165 toolkit_registry_manager, ToolkitRegistry, ToolkitWrapper
    166 """
    169 OPENEYE_AVAILABLE = False

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/toolkit/utils/toolkit_registry.py:127, in ToolkitRegistry.__init__(self, toolkit_precedence, exception_if_unavailable, _register_imported_toolkit_wrappers)
    125 if toolkit_classes_to_register:
    126     for toolkit in toolkit_classes_to_register:
--> 127         self.register_toolkit(
    128             toolkit_wrapper=toolkit,
    129             exception_if_unavailable=exception_if_unavailable,
    130         )

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/toolkit/utils/toolkit_registry.py:314, in ToolkitRegistry.register_toolkit(self, toolkit_wrapper, exception_if_unavailable)
    312 elif issubclass(toolkit_wrapper, ToolkitWrapper):
    313     try:
--> 314         _toolkit_wrapper = toolkit_wrapper()
    316     # This exception can be raised by OpenEyeToolkitWrapper
    317     except LicenseError as license_exception:

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/toolkit/utils/ambertools_wrapper.py:74, in AmberToolsToolkitWrapper.__init__(self)
     68 if not self.is_available():
     69     raise ToolkitUnavailableException(
     70         f"The required toolkit {self._toolkit_name} is not "
     71         f"available. {self._toolkit_installation_instructions}"
     72     )
---> 74 self._toolkit_version = get_ambertools_version()
     76 # TODO: Find AMBERHOME or executable home, checking miniconda if needed
     77 # Store an instance of an RDKitToolkitWrapper for file I/O
     78 self._rdkit_toolkit_wrapper = rdkit_wrapper.RDKitToolkitWrapper()

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/utilities/provenance.py:62, in get_ambertools_version()
     51 def get_ambertools_version() -> Optional[str]:
     52     """
     53     Attempts to retrieve the version of the currently installed AmberTools.
     54
   (...)
     59             still returns `None`, but without a warning associated with the above failure.
     60     """
---> 62     return _get_conda_list_package_versions().get("ambertools", None)

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/site-packages/openff/utilities/provenance.py:34, in _get_conda_list_package_versions()
     25     warnings.warn(
     26         "No conda/mamba/micromamba executable found. Unable to determine package versions.",
     27         CondaExecutableNotFoundWarning,
     28     )
     29     return dict()
     31 output = list(
     32     filter(
     33         lambda x: len(x) > 0,
---> 34         subprocess.check_output(conda_command.split()).decode().split("\n"),
     35     )
     36 )
     38 package_versions = {}
     40 # pixi has a brief header, others list "here's the path", etc

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/subprocess.py:465, in check_output(timeout, *popenargs, **kwargs)
    462         empty = b''
    463     kwargs['input'] = empty
--> 465 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    466            **kwargs).stdout

File ~/Documents/openff/openff-pablo/.soap/test/lib/python3.11/subprocess.py:569, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    567     retcode = process.poll()
    568     if check and retcode:
--> 569         raise CalledProcessError(retcode, process.args,
    570                                  output=stdout, stderr=stderr)
    571 return CompletedProcess(process.args, retcode, stdout, stderr)

CalledProcessError: Command '['pixi', 'list', '--color', 'never']' returned non-zero exit status 1.
micromamba list
 
  Name                           Version                          Build                              Channel
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  _libgcc_mutex                  0.1                              conda_forge                        conda-forge
  _openmp_mutex                  4.5                              2_gnu                              conda-forge
  ambertools                     23.6                             cuda_None_nompi_py311h4a53416_105  conda-forge
  anyio                          4.8.0                            pyhd8ed1ab_0                       conda-forge
  argon2-cffi                    23.1.0                           pyhd8ed1ab_1                       conda-forge
  argon2-cffi-bindings           21.2.0                           py311h9ecbd09_5                    conda-forge
  arpack                         3.9.1                            nompi_hf03ea27_102                 conda-forge
  arrow                          1.3.0                            pyhd8ed1ab_1                       conda-forge
  asttokens                      3.0.0                            pyhd8ed1ab_1                       conda-forge
  async-lru                      2.0.4                            pyhd8ed1ab_1                       conda-forge
  attrs                          25.1.0                           pyh71513ae_0                       conda-forge
  babel                          2.16.0                           pyhd8ed1ab_1                       conda-forge
  basedpyright                   1.25.0                           pyhd8ed1ab_0                       conda-forge
  beautifulsoup4                 4.12.3                           pyha770c72_1                       conda-forge
  biopython                      1.85                             py311h9ecbd09_1                    conda-forge
  black                          24.10.0                          py311h38be061_0                    conda-forge
  bleach                         6.2.0                            pyh29332c3_4                       conda-forge
  bleach-with-css                6.2.0                            h82add2a_4                         conda-forge
  blosc                          1.21.6                           he440d0b_1                         conda-forge
  brotli                         1.1.0                            hb9d3cd8_2                         conda-forge
  brotli-bin                     1.1.0                            hb9d3cd8_2                         conda-forge
  brotli-python                  1.1.0                            py311hfdbb021_2                    conda-forge
  bson                           0.5.10                           pyhd8ed1ab_0                       conda-forge
  bzip2                          1.0.8                            h4bc722e_7                         conda-forge
  c-ares                         1.34.4                           hb9d3cd8_0                         conda-forge
  ca-certificates                2024.12.14                       hbcca054_0                         conda-forge
  cached-property                1.5.2                            hd8ed1ab_1                         conda-forge
  cached_property                1.5.2                            pyha770c72_1                       conda-forge
  cachetools                     5.5.1                            pyhd8ed1ab_0                       conda-forge
  cairo                          1.18.2                           h3394656_1                         conda-forge
  cattrs                         24.1.2                           pyhd8ed1ab_1                       conda-forge
  certifi                        2024.12.14                       pyhd8ed1ab_0                       conda-forge
  cffi                           1.17.1                           py311hf29c0ef_0                    conda-forge
  cftime                         1.6.4                            py311h9f3472d_1                    conda-forge
  chardet                        5.2.0                            py311h38be061_2                    conda-forge
  charset-normalizer             3.4.1                            pyhd8ed1ab_0                       conda-forge
  click                          8.1.8                            pyh707e725_0                       conda-forge
  colorama                       0.4.6                            pyhd8ed1ab_1                       conda-forge
  comm                           0.2.2                            pyhd8ed1ab_1                       conda-forge
  contourpy                      1.3.1                            py311hd18a35c_0                    conda-forge
  cudatoolkit                    11.8.0                           h4ba93d1_13                        conda-forge
  cycler                         0.12.1                           pyhd8ed1ab_1                       conda-forge
  debugpy                        1.8.12                           py311hfdbb021_0                    conda-forge
  decorator                      5.1.1                            pyhd8ed1ab_1                       conda-forge
  defusedxml                     0.7.1                            pyhd8ed1ab_0                       conda-forge
  docstring-to-markdown          0.15                             pyhd8ed1ab_1                       conda-forge
  exceptiongroup                 1.2.2                            pyhd8ed1ab_1                       conda-forge
  execnet                        2.1.1                            pyhd8ed1ab_1                       conda-forge
  executing                      2.1.0                            pyhd8ed1ab_1                       conda-forge
  fasteners                      0.19                             pyhd8ed1ab_1                       conda-forge
  fftw                           3.3.10                           nompi_hf1063bd_110                 conda-forge
  font-ttf-dejavu-sans-mono      2.37                             hab24e00_0                         conda-forge
  font-ttf-inconsolata           3.000                            h77eed37_0                         conda-forge
  font-ttf-source-code-pro       2.038                            h77eed37_0                         conda-forge
  font-ttf-ubuntu                0.83                             h77eed37_3                         conda-forge
  fontconfig                     2.15.0                           h7e30c49_1                         conda-forge
  fonts-conda-ecosystem          1                                0                                  conda-forge
  fonts-conda-forge              1                                0                                  conda-forge
  fonttools                      4.55.8                           py311h2dc5d0c_0                    conda-forge
  fqdn                           1.5.1                            pyhd8ed1ab_1                       conda-forge
  freetype                       2.12.1                           h267a509_2                         conda-forge
  freetype-py                    2.3.0                            pyhd8ed1ab_0                       conda-forge
  greenlet                       3.1.1                            py311hfdbb021_1                    conda-forge
  griddataformats                1.0.2                            pyhd8ed1ab_1                       conda-forge
  gsd                            3.4.2                            py311h9ecbd09_0                    conda-forge
  h11                            0.14.0                           pyhd8ed1ab_1                       conda-forge
  h2                             4.1.0                            pyhd8ed1ab_1                       conda-forge
  h5py                           3.12.1                           nompi_py311h5ed33ec_103            conda-forge
  hdf4                           4.2.15                           h2a13503_7                         conda-forge
  hdf5                           1.14.4                           nompi_h2d575fe_105                 conda-forge
  hpack                          4.1.0                            pyhd8ed1ab_0                       conda-forge
  httpcore                       1.0.7                            pyh29332c3_1                       conda-forge
  httpx                          0.28.1                           pyhd8ed1ab_0                       conda-forge
  hyperframe                     6.1.0                            pyhd8ed1ab_0                       conda-forge
  icu                            75.1                             he02047a_0                         conda-forge
  idna                           3.10                             pyhd8ed1ab_1                       conda-forge
  importlib-metadata             8.6.1                            pyha770c72_0                       conda-forge
  importlib_resources            6.5.2                            pyhd8ed1ab_0                       conda-forge
  iniconfig                      2.0.0                            pyhd8ed1ab_1                       conda-forge
  ipykernel                      6.29.5                           pyh3099207_0                       conda-forge
  ipython                        8.31.0                           pyh707e725_0                       conda-forge
  ipywidgets                     8.1.5                            pyhd8ed1ab_1                       conda-forge
  isoduration                    20.11.0                          pyhd8ed1ab_1                       conda-forge
  isort                          6.0.0                            pyhd8ed1ab_0                       conda-forge
  jedi                           0.19.2                           pyhd8ed1ab_1                       conda-forge
  jedi-language-server           0.43.1                           pyhd8ed1ab_0                       conda-forge
  jinja2                         3.1.5                            pyhd8ed1ab_0                       conda-forge
  joblib                         1.4.2                            pyhd8ed1ab_1                       conda-forge
  json5                          0.10.0                           pyhd8ed1ab_1                       conda-forge
  jsonpointer                    3.0.0                            py311h38be061_1                    conda-forge
  jsonschema                     4.23.0                           pyhd8ed1ab_1                       conda-forge
  jsonschema-specifications      2024.10.1                        pyhd8ed1ab_1                       conda-forge
  jsonschema-with-format-nongpl  4.23.0                           hd8ed1ab_1                         conda-forge
  jupyter-lsp                    2.2.5                            pyhd8ed1ab_1                       conda-forge
  jupyter_client                 8.6.3                            pyhd8ed1ab_1                       conda-forge
  jupyter_core                   5.7.2                            pyh31011fe_1                       conda-forge
  jupyter_events                 0.11.0                           pyhd8ed1ab_0                       conda-forge
  jupyter_server                 2.15.0                           pyhd8ed1ab_0                       conda-forge
  jupyter_server_terminals       0.5.3                            pyhd8ed1ab_1                       conda-forge
  jupyterlab                     4.3.5                            pyhd8ed1ab_0                       conda-forge
  jupyterlab-lsp                 5.1.0                            pyhd8ed1ab_3                       conda-forge
  jupyterlab-mathjax3            4.3.0                            pyhd8ed1ab_1                       conda-forge
  jupyterlab_code_formatter      3.0.2                            pyhd8ed1ab_1                       conda-forge
  jupyterlab_execute_time        3.2.0                            pyhd8ed1ab_1                       conda-forge
  jupyterlab_pygments            0.3.0                            pyhd8ed1ab_2                       conda-forge
  jupyterlab_rise                0.43.1                           pyhd8ed1ab_0                       conda-forge
  jupyterlab_server              2.27.3                           pyhd8ed1ab_1                       conda-forge
  jupyterlab_widgets             3.0.13                           pyhd8ed1ab_1                       conda-forge
  kernel-headers_linux-64        3.10.0                           he073ed8_18                        conda-forge
  keyutils                       1.6.1                            h166bdaf_0                         conda-forge
  kiwisolver                     1.4.7                            py311hd18a35c_0                    conda-forge
  krb5                           1.21.3                           h659f571_0                         conda-forge
  lcms2                          2.16                             hb7c19ff_0                         conda-forge
  ld_impl_linux-64               2.43                             h712a8e2_2                         conda-forge
  lerc                           4.0.0                            h27087fc_0                         conda-forge
  libaec                         1.1.3                            h59595ed_0                         conda-forge
  libblas                        3.9.0                            28_h59b9bed_openblas               conda-forge
  libboost                       1.84.0                           h6c02f8c_7                         conda-forge
  libboost-python                1.84.0                           py311h5b7b71f_7                    conda-forge
  libbrotlicommon                1.1.0                            hb9d3cd8_2                         conda-forge
  libbrotlidec                   1.1.0                            hb9d3cd8_2                         conda-forge
  libbrotlienc                   1.1.0                            hb9d3cd8_2                         conda-forge
  libcblas                       3.9.0                            28_he106b2a_openblas               conda-forge
  libcurl                        8.11.1                           h332b0f4_0                         conda-forge
  libdeflate                     1.23                             h4ddbbb0_0                         conda-forge
  libedit                        3.1.20240808                     pl5321h7949ede_0                   conda-forge
  libev                          4.33                             hd590300_2                         conda-forge
  libexpat                       2.6.4                            h5888daf_0                         conda-forge
  libffi                         3.4.2                            h7f98852_5                         conda-forge
  libgcc                         14.2.0                           h77fa898_1                         conda-forge
  libgcc-ng                      14.2.0                           h69a702a_1                         conda-forge
  libgfortran                    14.2.0                           h69a702a_1                         conda-forge
  libgfortran-ng                 14.2.0                           h69a702a_1                         conda-forge
  libgfortran5                   14.2.0                           hd5240d6_1                         conda-forge
  libglib                        2.82.2                           h2ff4ddf_1                         conda-forge
  libgomp                        14.2.0                           h77fa898_1                         conda-forge
  libiconv                       1.17                             hd590300_2                         conda-forge
  libjpeg-turbo                  3.0.0                            hd590300_1                         conda-forge
  liblapack                      3.9.0                            28_h7ac8fdf_openblas               conda-forge
  liblzma                        5.6.3                            hb9d3cd8_1                         conda-forge
  liblzma-devel                  5.6.3                            hb9d3cd8_1                         conda-forge
  libnetcdf                      4.9.2                            nompi_h5ddbaa4_116                 conda-forge
  libnghttp2                     1.64.0                           h161d5f1_0                         conda-forge
  libnsl                         2.0.1                            hd590300_0                         conda-forge
  libopenblas                    0.3.28                           pthreads_h94d23a6_1                conda-forge
  libpng                         1.6.46                           h943b412_0                         conda-forge
  libpq                          16.6                             h035377e_1                         conda-forge
  librdkit                       2024.03.6                        h04b5189_0                         conda-forge
  libsodium                      1.0.20                           h4ab18f5_0                         conda-forge
  libsqlite                      3.48.0                           hee588c1_1                         conda-forge
  libssh2                        1.11.1                           hf672d98_0                         conda-forge
  libstdcxx                      14.2.0                           hc0a3c3a_1                         conda-forge
  libstdcxx-ng                   14.2.0                           h4852527_1                         conda-forge
  libtiff                        4.7.0                            hd9ff511_3                         conda-forge
  libuuid                        2.38.1                           h0b41bf4_0                         conda-forge
  libuv                          1.50.0                           hb9d3cd8_0                         conda-forge
  libwebp-base                   1.5.0                            h851e524_0                         conda-forge
  libxcb                         1.17.0                           h8a09558_0                         conda-forge
  libxcrypt                      4.4.36                           hd590300_1                         conda-forge
  libxml2                        2.13.5                           h8d12d68_1                         conda-forge
  libzip                         1.11.2                           h6991a6a_0                         conda-forge
  libzlib                        1.3.1                            hb9d3cd8_2                         conda-forge
  lsprotocol                     2023.0.1                         pyhd8ed1ab_1                       conda-forge
  lz4-c                          1.10.0                           h5888daf_1                         conda-forge
  markupsafe                     3.0.2                            py311h2dc5d0c_1                    conda-forge
  matplotlib-base                3.10.0                           py311h2b939e6_0                    conda-forge
  matplotlib-inline              0.1.7                            pyhd8ed1ab_1                       conda-forge
  mda-xdrlib                     0.2.0                            pyhd8ed1ab_1                       conda-forge
  mdahole2-base                  0.5.0                            pyhd8ed1ab_1                       conda-forge
  mdanalysis                     2.8.0                            py311h7db5c69_0                    conda-forge
  mistune                        3.1.1                            pyhd8ed1ab_0                       conda-forge
  mmtf-python                    1.1.3                            pyhd8ed1ab_0                       conda-forge
  mrcfile                        1.5.4                            pyhd8ed1ab_0                       conda-forge
  msgpack-python                 1.1.0                            py311hd18a35c_0                    conda-forge
  munkres                        1.1.4                            pyh9f0ad1d_0                       conda-forge
  mypy_extensions                1.0.0                            pyha770c72_1                       conda-forge
  nbclient                       0.10.2                           pyhd8ed1ab_0                       conda-forge
  nbconvert-core                 7.16.6                           pyh29332c3_0                       conda-forge
  nbformat                       5.10.4                           pyhd8ed1ab_1                       conda-forge
  ncurses                        6.5                              h2d0b736_3                         conda-forge
  nest-asyncio                   1.6.0                            pyhd8ed1ab_1                       conda-forge
  netcdf-fortran                 4.6.1                            nompi_ha5d1325_108                 conda-forge
  netcdf4                        1.7.2                            nompi_py311h7c29e4f_101            conda-forge
  networkx                       3.4.2                            pyh267e887_2                       conda-forge
  nglview                        3.0.8                            pyh1da8cd4_0                       conda-forge
  nodejs                         22.12.0                          hf235a45_0                         conda-forge
  nodejs-wheel                   22.13.1                          pyhd8ed1ab_0                       conda-forge
  notebook-shim                  0.2.4                            pyhd8ed1ab_1                       conda-forge
  numpy                          1.26.4                           py311h64a7726_0                    conda-forge
  ocl-icd                        2.3.2                            hb9d3cd8_2                         conda-forge
  ocl-icd-system                 1.0.0                            1                                  conda-forge
  opencl-headers                 2024.10.24                       h5888daf_0                         conda-forge
  openff-amber-ff-ports          0.0.4                            pyhca7485f_0                       conda-forge
  openff-forcefields             2024.09.0                        pyhff2d567_0                       conda-forge
  openff-pablo                   0.0.0.post71+g824f281.d20250130  pypi_0                             pypi
  openff-toolkit                 0.16.7.post23+g83a28798          pypi_0                             pypi
  openff-toolkit-base            0.16.7                           pyhd8ed1ab_0                       conda-forge
  openff-units                   0.2.2                            pyhd8ed1ab_1                       conda-forge
  openff-utilities               0.1.14                           pyhd8ed1ab_0                       conda-forge
  openjpeg                       2.5.3                            h5fbd93e_0                         conda-forge
  openmm                         8.2.0                            py311he040c58_1                    conda-forge
  openssl                        3.4.0                            h7b32b05_1                         conda-forge
  overrides                      7.7.0                            pyhd8ed1ab_1                       conda-forge
  packaging                      24.2                             pyhd8ed1ab_2                       conda-forge
  pandas                         2.2.3                            py311h7db5c69_1                    conda-forge
  pandocfilters                  1.5.0                            pyhd8ed1ab_0                       conda-forge
  parmed                         4.3.0                            py311h8cc7b42_0                    conda-forge
  parso                          0.8.4                            pyhd8ed1ab_1                       conda-forge
  pathsimanalysis                1.2.0                            pyhd8ed1ab_1                       conda-forge
  pathspec                       0.12.1                           pyhd8ed1ab_1                       conda-forge
  patsy                          1.0.1                            pyhd8ed1ab_1                       conda-forge
  pcre2                          10.44                            hba22ea6_2                         conda-forge
  pdbfixer                       1.10                             pyhff2d567_0                       conda-forge
  perl                           5.32.1                           7_hd590300_perl5                   conda-forge
  pexpect                        4.9.0                            pyhd8ed1ab_1                       conda-forge
  pickleshare                    0.7.5                            pyhd8ed1ab_1004                    conda-forge
  pillow                         11.1.0                           py311h1322bbf_0                    conda-forge
  pint                           0.23                             pyhd8ed1ab_1                       conda-forge
  pip                            25.0                             pyh8b19718_0                       conda-forge
  pixman                         0.44.2                           h29eaf8c_0                         conda-forge
  pkgutil-resolve-name           1.3.10                           pyhd8ed1ab_2                       conda-forge
  platformdirs                   4.3.6                            pyhd8ed1ab_1                       conda-forge
  pluggy                         1.5.0                            pyhd8ed1ab_1                       conda-forge
  prometheus_client              0.21.1                           pyhd8ed1ab_0                       conda-forge
  prompt-toolkit                 3.0.50                           pyha770c72_0                       conda-forge
  psutil                         6.1.1                            py311h9ecbd09_0                    conda-forge
  pthread-stubs                  0.4                              hb9d3cd8_1002                      conda-forge
  ptyprocess                     0.7.0                            pyhd8ed1ab_1                       conda-forge
  pure_eval                      0.2.3                            pyhd8ed1ab_1                       conda-forge
  pycairo                        1.27.0                           py311h124c5f0_0                    conda-forge
  pycparser                      2.22                             pyh29332c3_1                       conda-forge
  pyedr                          0.8.0                            pyhd8ed1ab_1                       conda-forge
  pygls                          1.3.1                            pyhd8ed1ab_1                       conda-forge
  pygments                       2.19.1                           pyhd8ed1ab_0                       conda-forge
  pyparsing                      3.2.1                            pyhd8ed1ab_0                       conda-forge
  pysocks                        1.7.1                            pyha55dd90_7                       conda-forge
  pytest                         8.3.4                            pyhd8ed1ab_1                       conda-forge
  pytest-xdist                   3.6.1                            pyhd8ed1ab_1                       conda-forge
  python                         3.11.0                           he550d4f_1_cpython                 conda-forge
  python-constraint              1.4.0                            pyhff2d567_1                       conda-forge
  python-dateutil                2.9.0.post0                      pyhff2d567_1                       conda-forge
  python-fastjsonschema          2.21.1                           pyhd8ed1ab_0                       conda-forge
  python-json-logger             2.0.7                            pyhd8ed1ab_0                       conda-forge
  python-tzdata                  2025.1                           pyhd8ed1ab_0                       conda-forge
  python_abi                     3.11                             5_cp311                            conda-forge
  pytng                          0.3.3                            py311h0eb78d4_1                    conda-forge
  pytz                           2024.1                           pyhd8ed1ab_0                       conda-forge
  pyyaml                         6.0.2                            py311h2dc5d0c_2                    conda-forge
  pyzmq                          26.2.0                           py311h7deb3e3_3                    conda-forge
  qhull                          2020.2                           h434a139_5                         conda-forge
  rdkit                          2024.03.6                        py311ha09a670_0                    conda-forge
  readline                       8.2                              h8228510_1                         conda-forge
  referencing                    0.36.2                           pyh29332c3_0                       conda-forge
  reportlab                      4.2.5                            py311h9ecbd09_0                    conda-forge
  requests                       2.32.3                           pyhd8ed1ab_1                       conda-forge
  rfc3339-validator              0.1.4                            pyhd8ed1ab_1                       conda-forge
  rfc3986-validator              0.1.1                            pyh9f0ad1d_0                       conda-forge
  rlpycairo                      0.2.0                            pyhd8ed1ab_0                       conda-forge
  rpds-py                        0.22.3                           py311h9e33e62_0                    conda-forge
  ruff                           0.9.3                            py311h100434b_0                    conda-forge
  scikit-learn                   1.6.1                            py311h57cc02b_0                    conda-forge
  scipy                          1.15.1                           py311hc1ac118_0                    conda-forge
  seaborn                        0.13.2                           hd8ed1ab_3                         conda-forge
  seaborn-base                   0.13.2                           pyhd8ed1ab_3                       conda-forge
  send2trash                     1.8.3                            pyh0d859eb_1                       conda-forge
  setuptools                     75.8.0                           pyhff2d567_0                       conda-forge
  six                            1.17.0                           pyhd8ed1ab_0                       conda-forge
  smirnoff99frosst               1.1.0                            pyh44b312d_0                       conda-forge
  snakeviz                       2.2.2                            pyhd8ed1ab_1                       conda-forge
  snappy                         1.2.1                            h8bd8927_1                         conda-forge
  sniffio                        1.3.1                            pyhd8ed1ab_1                       conda-forge
  soupsieve                      2.5                              pyhd8ed1ab_1                       conda-forge
  sqlalchemy                     2.0.37                           py311h9ecbd09_0                    conda-forge
  stack_data                     0.6.3                            pyhd8ed1ab_1                       conda-forge
  statsmodels                    0.14.4                           py311h9f3472d_0                    conda-forge
  sysroot_linux-64               2.17                             h0157908_18                        conda-forge
  terminado                      0.18.1                           pyh0d859eb_0                       conda-forge
  threadpoolctl                  3.5.0                            pyhc1e730c_0                       conda-forge
  tidynamics                     1.1.2                            pyhd8ed1ab_0                       conda-forge
  tinycss2                       1.4.0                            pyhd8ed1ab_0                       conda-forge
  tk                             8.6.13                           noxft_h4845f30_101                 conda-forge
  tomli                          2.2.1                            pyhd8ed1ab_1                       conda-forge
  tornado                        6.4.2                            py311h9ecbd09_0                    conda-forge
  tqdm                           4.67.1                           pyhd8ed1ab_1                       conda-forge
  traitlets                      5.14.3                           pyhd8ed1ab_1                       conda-forge
  types-python-dateutil          2.9.0.20241206                   pyhd8ed1ab_0                       conda-forge
  typing-extensions              4.12.2                           hd8ed1ab_1                         conda-forge
  typing_extensions              4.12.2                           pyha770c72_1                       conda-forge
  typing_utils                   0.1.0                            pyhd8ed1ab_1                       conda-forge
  tzdata                         2025a                            h78e105d_0                         conda-forge
  unicodedata2                   16.0.0                           py311h9ecbd09_0                    conda-forge
  uri-template                   1.3.0                            pyhd8ed1ab_1                       conda-forge
  urllib3                        2.3.0                            pyhd8ed1ab_0                       conda-forge
  waterdynamics                  1.2.0                            pyhd8ed1ab_1                       conda-forge
  wcwidth                        0.2.13                           pyhd8ed1ab_1                       conda-forge
  webcolors                      24.11.1                          pyhd8ed1ab_0                       conda-forge
  webencodings                   0.5.1                            pyhd8ed1ab_3                       conda-forge
  websocket-client               1.8.0                            pyhd8ed1ab_1                       conda-forge
  wheel                          0.45.1                           pyhd8ed1ab_1                       conda-forge
  widgetsnbextension             4.0.13                           pyhd8ed1ab_1                       conda-forge
  xmltodict                      0.14.2                           pyhd8ed1ab_1                       conda-forge
  xorg-libice                    1.1.2                            hb9d3cd8_0                         conda-forge
  xorg-libsm                     1.2.5                            he73a12e_0                         conda-forge
  xorg-libx11                    1.8.10                           h4f16b4b_1                         conda-forge
  xorg-libxau                    1.0.12                           hb9d3cd8_0                         conda-forge
  xorg-libxdmcp                  1.1.5                            hb9d3cd8_0                         conda-forge
  xorg-libxext                   1.3.6                            hb9d3cd8_0                         conda-forge
  xorg-libxrender                0.9.12                           hb9d3cd8_0                         conda-forge
  xorg-libxt                     1.3.1                            hb9d3cd8_0                         conda-forge
  xz                             5.6.3                            hbcc6ac9_1                         conda-forge
  xz-gpl-tools                   5.6.3                            hbcc6ac9_1                         conda-forge
  xz-tools                       5.6.3                            hb9d3cd8_1                         conda-forge
  yaml                           0.2.5                            h7f98852_2                         conda-forge
  zeromq                         4.3.5                            h3b0a872_7                         conda-forge
  zipp                           3.21.0                           pyhd8ed1ab_1                       conda-forge
  zlib                           1.3.1                            hb9d3cd8_2                         conda-forge
  zstandard                      0.23.0                           py311hbc35293_1                    conda-forge
  zstd                           1.5.6                            ha6fb4c9_0                         conda-forge
@Yoshanuikabundi
Copy link
Author

I think the existing Pixi behaviour would also get the wrong environment if I was running a Pixi task outside of the default environment.

@mattwthompson
Copy link
Member

Ugh, this tries to warn instead of error when something in that pipeline fails. Time to add another clause ...

@mattwthompson
Copy link
Member

How should we handle each of these errors, do you think?

@Yoshanuikabundi
Copy link
Author

Yoshanuikabundi commented Jan 30, 2025

I think maybe pixi should just be the last thing checked? It's behaviour is technically incorrect (for this use case) and it only works in an appropriate project. If any of the other tools are available, they should be run inside the environment and just work shouldn't they?

Otherwise, falling back to another tool in each case would be fine. It might also be worth having a non-terminal behaviour if the version cannot be determined, but maybe that needs to go in the Toolkit.

@mattwthompson
Copy link
Member

I recall intentionally trying pixi first, but I'm not sure the reason off-hand

Need to think about it more but given the range of possible outcomes in that block, I think wrapping the actual call to that function and returning None if ~anything bad happens is a solution worth considering.

diff --git a/openff/utilities/provenance.py b/openff/utilities/provenance.py
index a42995a..5c990d9 100644
--- a/openff/utilities/provenance.py
+++ b/openff/utilities/provenance.py
@@ -59,4 +59,7 @@ def get_ambertools_version() -> Optional[str]:
             still returns `None`, but without a warning associated with the above failure.
     """
 
-    return _get_conda_list_package_versions().get("ambertools", None)
+    try:
+        return _get_conda_list_package_versions().get("ambertools", None)
+    except Exception:  # just capture everything lol
+        return None

I think this is more or less your last suggestion above?

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