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

BUG: Compatibility Issue for pytensor on macOS 15.4 #1342

Open
astrokang opened this issue Apr 2, 2025 · 16 comments
Open

BUG: Compatibility Issue for pytensor on macOS 15.4 #1342

astrokang opened this issue Apr 2, 2025 · 16 comments
Labels
bug Something isn't working

Comments

@astrokang
Copy link

Describe the issue:

After updating to macOS 15.4, I encountered a failure when running pymc with pytensor. The error seems to be related to constant folding during graph optimization and LTO (Link Time Optimization) issues during compilation. I don't know. But I have tested that this issue does not occur on macOS 14.x.

Reproduceable code example:

import numpy as np
import pymc as pm
        

def pymc_fitting(x_obs, y_obs, y_err, if_xerr = False, x_err = 0., 
                 if_intrin = True,
                 x_fit_low = None, x_fit_upp = None, 
                 CL_value = 0.90, random_seed = 12):

    """
    Fitting function with pymc

    Parameters:
    
    - x_obs (array): x-axis observed values
    - y_obs (array): y-axis observed values
    - y_err (array): y-axis error values
    - if_xerr (bool): whether consider x-axis error
    - x_err (array): x-axis error values
    - x_fit_low (float): lower limit of x-axis for fitting
    - x_fit_upp (float): upper limit of x-axis for fitting
    - CL_value (float): confidence level value
    - random_seed (int): random seed value

    Returns:

    [x_fit, y_fit_med, [y_fit_low, y_fit_upp]]
    
    - x_fit (array): x-axis fitting values
    - y_fit_med (array): y-axis fitting values
    - y_fit_low (array): y-axis fitting values (lower limit)
    - y_fit_upp (array): y-axis fitting values (upper limit)
    """
    
    # Defime PyMC model and consider linear fitting ("model" Processed implicitly by PyMC)
    with pm.Model() as model:
        
        # Priors for slope and intercept
        k_value = pm.Uniform("slope", lower = -10, upper = 10)
        b_value = pm.Uniform("intercept", lower = -10, upper = 10)

        if not if_xerr:

            x_true_est = x_obs
            
        else:
            
            # Hidden variable for true x values (considering x-axis parameter error)
            x_true_est = pm.Normal("x_true", mu = x_obs, sigma = x_err, shape = len(x_obs))
        
        # Calculate the expected value of y (fitting function)
        y_est = k_value * x_true_est + b_value

        # Whether consider x-axis error
        if if_intrin:

            sigma_scatter = pm.HalfNormal("sigma_scatter", sigma = 1)

        else:

            sigma_scatter = 0
        
        # Observed y error (Implicit likelihood calculation)
        y_obs_likelihood = pm.Normal("y_obs", mu = y_est, sigma = np.sqrt(y_err**2 + sigma_scatter**2), observed = y_obs)
    
        # Sample from the posterior
        trace = pm.sample(5000, return_inferencedata = True, chains = 4, target_accept = 0.99, random_seed = random_seed)


    k_samples = trace.posterior["slope"].values.flatten()
    b_samples = trace.posterior["intercept"].values.flatten()

    if x_fit_low is None:

        x_fit_low = min(x_obs)
        x_fit_upp = max(x_obs)

    x_fit = np.linspace(x_fit_low, x_fit_upp, 1000)
    
    # Calculate the fitted y values for each sample
    y_fit_samples = np.outer(k_samples, x_fit) + b_samples[:, None]
    
    # Calculate the mean and confidence intervals for the fitted y values 
    y_fit_med = np.percentile(y_fit_samples, 50, axis = 0)
    y_fit_low = np.percentile(y_fit_samples, 50 * (1 - CL_value), axis = 0)
    y_fit_upp = np.percentile(y_fit_samples, 50 * (1 + CL_value), axis = 0)
    

    return [x_fit, y_fit_med, [y_fit_low, y_fit_upp]]




# Random seed   
np.random.seed(12)

# True line
k_true = 2
b_true = -5

x_true = np.linspace(0, 10, 50)
y_true = k_true * x_true + b_true

x_plot = np.linspace(-1, 11, 50)
ax_main.plot(x_plot, k_true * x_plot + b_true, label = label_list[0],
             color = 'k', linewidth = 10, linestyle = '-', zorder = 5)

# Observed data
x_err = np.random.uniform(0.2, 0.6, size = len(x_true))
x_obs = x_true + np.random.normal(size = len(x_true)) * x_err

intrin_sig = 2        # Intrinsic scatter
y_err = np.random.uniform(1, 3, size = len(x_true))
y_obs = y_true + np.random.normal(size = len(x_true)) * np.sqrt(y_err**2 + intrin_sig**2)


# pymc fitting
# interval_list = [x_fit, y_fit_mean, [y_fit_low, y_fit_upp]]
interval_list = pymc_fitting(x_obs, y_obs, y_err, if_xerr = True, x_err = x_err, 
                             CL_value = 0.90, random_seed = 12)

Error message:

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: ExpandDims{axis=0}(2)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/graph/rewriting/basic.py", line 1916, in process_node
    replacements = node_rewriter.transform(fgraph, node)
  File "/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/graph/rewriting/basic.py", line 1086, in transform
    return self.fn(fgraph, node)
           ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/tensor/rewriting/basic.py", line 1173, in constant_folding
    return unconditional_constant_folding.transform(fgraph, node)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/graph/rewriting/basic.py", line 1086, in transform
    return self.fn(fgraph, node)
           ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/tensor/rewriting/basic.py", line 1122, in unconditional_constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
  File "/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
        input_storage=node_input_storage, output_storage=node_output_storage
    )
  File "/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/link/c/basic.py", line 1185, in make_thunk
...
ld: -lto_library library filename must be 'libLTO.dylib'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?87be159b-d347-49e3-8226-abc1672dda64) or open in a [text editor](command:workbench.action.openLargeOutput?87be159b-d347-49e3-8226-abc1672dda64). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/ch/qk2fyfsd5f75z607yqb892200000gn/T/pytensor_compilation_error_xiy08s1v](https://file+.vscode-resource.vscode-cdn.net/var/folders/ch/qk2fyfsd5f75z607yqb892200000gn/T/pytensor_compilation_error_xiy08s1v)
library to_library is not found.

......

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
File ~/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/link/c/lazylinker_c.py:66
     65         if version != actual_version:
---> 66             raise ImportError(
     67                 "Version check of the existing lazylinker compiled file."
     68                 f" Looking for version {version}, but found {actual_version}. "
     69                 f"Extra debug information: force_compile={force_compile}, _need_reload={_need_reload}"
     70             )
     71 except ImportError:

ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.3, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
File ~/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/link/c/lazylinker_c.py:87
     86     if version != actual_version:
---> 87         raise ImportError(
     88             "Version check of the existing lazylinker compiled file."
     89             f" Looking for version {version}, but found {actual_version}. "
     90             f"Extra debug information: force_compile={force_compile}, _need_reload={_need_reload}"
     91         )
     92 except ImportError:
     93     # It is useless to try to compile if there isn't any
...
CompileError: Compilation failed (return status=1):
/Users/dendrophile/miniconda3/envs/pymc_env/bin/clang++ -dynamiclib -g -Wno-c++11-narrowing -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -fPIC -undefined dynamic_lookup -ld64 -I/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/numpy/_core/include -I/Users/dendrophile/miniconda3/envs/pymc_env/include/python3.13 -I/Users/dendrophile/miniconda3/envs/pymc_env/lib/python3.13/site-packages/pytensor/link/c/c_code -L/Users/dendrophile/miniconda3/envs/pymc_env/lib -fvisibility=hidden -o /Users/dendrophile/.pytensor/compiledir_macOS-15.4-arm64-arm-64bit-Mach-O-arm-3.13.2-64/lazylinker_ext/lazylinker_ext.so /Users/dendrophile/.pytensor/compiledir_macOS-15.4-arm64-arm-64bit-Mach-O-arm-3.13.2-64/lazylinker_ext/mod.cpp
ld: -lto_library library filename must be 'libLTO.dylib'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

PyMC version information:

Environment
• macOS version: 15.4
• Python version: 3.13 (inside Conda environment)
• pytensor version: (latest from conda-forge)
• pymc version: 5.21.1

Context for the issue:

I have successfully run my code just a week before, but now it has failed, just after I updated my macOS to 15.4 yesterday. Tested on macOS 14 (inside a VM) and everything worked fine, confirming that the issue is specific to macOS 15.4.

@astrokang astrokang added the bug Something isn't working label Apr 2, 2025
Copy link

welcome bot commented Apr 2, 2025

Welcome Banner]
🎉 Welcome to PyMC! 🎉 We're really excited to have your input into the project! 💖

If you haven't done so already, please make sure you check out our Contributing Guidelines and Code of Conduct.

@astrokang
Copy link
Author

Revise: pytensor version: 2.28.3 (latest for PyMC from conda-forge)

@ricardoV94
Copy link
Member

CC @maresb @lucianopaz

@ricardoV94 ricardoV94 transferred this issue from pymc-devs/pymc Apr 2, 2025
@lingjie00
Copy link

lingjie00 commented Apr 3, 2025

Facing this issue as well, I suspect it's related to command line tool v16.3.

Interestingly, this issue only seems to happen within VSCode environment and does not affect when I run in terminal.

Previously it was working on VSCode terminal, but now it failed even in VSCode terminal. mmm

UPDATE:
So I think somehow it's related to the exectuables in conda, I changed the order of PATH and now it works in VSCode terminal as well

# failing PATH
/opt/homebrew/Caskroom/miniforge/base/envs/pymc/bin:/opt/homebrew/Caskroom/miniforge/base/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/ling/Library/Application Support/Code/User/globalStorage/github.copilot-chat/debugCommand

# working PATH
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/ling/Library/Application Support/Code/User/globalStorage/github.copilot-chat/debugCommand:/opt/homebrew/Caskroom/miniforge/base/envs/pymc/bin:/opt/homebrew/Caskroom/miniforge/base/condabin

@astrokang
Copy link
Author

THX! @lingjie00

I have also tested the solutions following @lingjie00 's suggestions. For now, I think PyMC/PyTensor compilation failures on macOS 15.4 were caused by using conda-installed clang++ instead of the system compiler. The conda version created incompatible LTO library links.

So one of my suggested solution (simpler) is as follows:

# Problematic path in conda environment
(pymc_env) $ which clang++
/Users/USER/miniconda3/envs/pymc_env/bin/clang++  ❌

# Remove conda's compiler toolchain
conda remove --force clang clangxx -n pymc_env

# Verification
(pymc_env) $ which clang++
/usr/bin/clang++  ✅

Key Fix: Forcing the environment to use macOS system compilers instead of conda's versions resolves LTO linking issues.

This solution worked consistently across VSCode and terminal after PATH adjustments! 😃

@ricardoV94 ricardoV94 reopened this Apr 6, 2025
@ricardoV94
Copy link
Member

Reopening because users will keep seeing this problem

@ricardoV94
Copy link
Member

@maresb do you know if there's any open issue on conda related to clang?

@maresb
Copy link
Contributor

maresb commented Apr 6, 2025

I had a look and I didn't find any recent relevant issues around conda. I did find this SO post by @corneliusroemer and this Discourse thread about this same issue.

I see that libLTO.dylib is provided by the llvmdev conda-forge package, so I wonder if this is a missing dependency? It's bad to mix conda-forge and system packages like in the current workaround.

I don't use Mac, so I don't have any good way to test myself. Would anyone else be able to test if installing llvmdev is another viable workaround?

@astrokang
Copy link
Author

astrokang commented Apr 6, 2025

THX for @maresb's reply and suggestions.

I have tried, as you advised, installing llvmdev. However, it doesn't work for solving the problem. 🤔 So, up till now, conda remove --force clang clangxx -n pymc_env seems to be the only one simplest way, at least for me.

@maresb
Copy link
Contributor

maresb commented Apr 6, 2025

Thanks @astrokang for the quick answer!

Is the error message still ld: -lto_library library filename must be 'libLTO.dylib'?

@astrokang
Copy link
Author

Yes, the same problem again @maresb :

ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: ExpandDims{axis=0}(2)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/dendrophile/miniconda3/envs/test_env/lib/python3.13/site-packages/pytensor/graph/rewriting/basic.py", line 1922, in process_node
    replacements = node_rewriter.transform(fgraph, node)
  File "/Users/dendrophile/miniconda3/envs/test_env/lib/python3.13/site-packages/pytensor/graph/rewriting/basic.py", line 1086, in transform
    return self.fn(fgraph, node)
           ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/dendrophile/miniconda3/envs/test_env/lib/python3.13/site-packages/pytensor/tensor/rewriting/basic.py", line 1173, in constant_folding
    return unconditional_constant_folding.transform(fgraph, node)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/Users/dendrophile/miniconda3/envs/test_env/lib/python3.13/site-packages/pytensor/graph/rewriting/basic.py", line 1086, in transform
    return self.fn(fgraph, node)
           ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/dendrophile/miniconda3/envs/test_env/lib/python3.13/site-packages/pytensor/tensor/rewriting/basic.py", line 1122, in unconditional_constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
  File "/Users/dendrophile/miniconda3/envs/test_env/lib/python3.13/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dendrophile/miniconda3/envs/test_env/lib/python3.13/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
        input_storage=node_input_storage, output_storage=node_output_storage
    )
  File "/Users/dendrophile/miniconda3/envs/test_env/lib/python3.13/site-packages/pytensor/link/c/basic.py", line 1185, in make_thunk
...
ld: -lto_library library filename must be 'libLTO.dylib'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?88723952-b902-481c-a630-4dca737229b6) or open in a [text editor](command:workbench.action.openLargeOutput?88723952-b902-481c-a630-4dca737229b6). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/ch/qk2fyfsd5f75z607yqb892200000gn/T/pytensor_compilation_error_ujd0relt](https://file+.vscode-resource.vscode-cdn.net/var/folders/ch/qk2fyfsd5f75z607yqb892200000gn/T/pytensor_compilation_error_ujd0relt)
library to_library is not found.

......

Here is my setup workflow:

conda create -c conda-forge -n test_env "pymc>=5"   
conda activate test_env
conda install -c conda-forge nutpie blackjax numpyro astropy notebook llvmdev

and the setup details within the conda environmen:

name: test_env
channels:
  - conda-forge
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
dependencies:
  - absl-py=2.2.0=pyhd8ed1ab_0
  - accelerate=1.5.2=pyhd8ed1ab_0
  - adwaita-icon-theme=48.0=unix_0
  - aiobotocore=2.21.1=pyhd8ed1ab_0
  - aiohappyeyeballs=2.6.1=pyhd8ed1ab_0
  - aiohttp=3.11.16=py313ha9b7d5b_0
  - aioitertools=0.12.0=pyhd8ed1ab_1
  - aiosignal=1.3.2=pyhd8ed1ab_0
  - anyio=4.9.0=pyh29332c3_0
  - appnope=0.1.4=pyhd8ed1ab_1
  - argon2-cffi=23.1.0=pyhd8ed1ab_1
  - argon2-cffi-bindings=21.2.0=py313h20a7fcf_5
  - arrow=1.3.0=pyhd8ed1ab_1
  - arviz=0.21.0=pyhd8ed1ab_0
  - astropy=7.0.1=pyhd8ed1ab_0
  - astropy-base=7.0.1=py313h61b28de_0
  - astropy-iers-data=0.2025.3.31.0.36.18=pyhd8ed1ab_0
  - asttokens=3.0.0=pyhd8ed1ab_1
  - async-lru=2.0.5=pyh29332c3_0
  - atk-1.0=2.38.0=hd03087b_2
  - attrs=25.3.0=pyh71513ae_0
  - aws-c-auth=0.8.7=h771b9f8_1
  - aws-c-cal=0.8.7=hf78e982_1
  - aws-c-common=0.12.1=h5505292_0
  - aws-c-compression=0.3.1=h2da6199_3
  - aws-c-event-stream=0.5.4=hc8cef5c_3
  - aws-c-http=0.9.5=h7ae4978_0
  - aws-c-io=0.17.0=hda12475_8
  - aws-c-mqtt=0.12.2=hd618802_3
  - aws-c-s3=0.7.13=hb321cbc_3
  - aws-c-sdkutils=0.2.3=h2da6199_3
  - aws-checksums=0.2.3=h2da6199_3
  - aws-crt-cpp=0.31.1=hf6bcbf0_1
  - aws-sdk-cpp=1.11.510=hbf97231_4
  - azure-core-cpp=1.14.0=hd50102c_0
  - azure-identity-cpp=1.10.0=hc602bab_0
  - azure-storage-blobs-cpp=12.13.0=h7585a09_1
  - azure-storage-common-cpp=12.8.0=h9ca1f76_1
  - azure-storage-files-datalake-cpp=12.12.0=hcdd55da_1
  - babel=2.17.0=pyhd8ed1ab_0
  - beautifulsoup4=4.13.3=pyha770c72_0
  - blackjax=1.2.4=pyhd8ed1ab_1
  - blas=2.131=openblas
  - blas-devel=3.9.0=31_h11c0a38_openblas
  - bleach=6.2.0=pyh29332c3_4
  - bleach-with-css=6.2.0=h82add2a_4
  - botocore=1.37.1=pyge310_1234567_0
  - bottleneck=1.4.2=py313hde99e4e_0
  - bqplot=0.12.43=pyhd8ed1ab_1
  - brotli=1.1.0=hd74edd7_2
  - brotli-bin=1.1.0=hd74edd7_2
  - brotli-python=1.1.0=py313h3579c5c_2
  - bzip2=1.0.8=h99b78c6_7
  - c-ares=1.34.4=h5505292_0
  - ca-certificates=2025.1.31=hf0a4a13_0
  - cached-property=1.5.2=hd8ed1ab_1
  - cached_property=1.5.2=pyha770c72_1
  - cachetools=5.5.2=pyhd8ed1ab_0
  - cairo=1.18.4=h6a3b0d2_0
  - cctools_osx-arm64=1010.6=h3b4f5d3_6
  - certifi=2025.1.31=pyhd8ed1ab_0
  - cffi=1.17.1=py313hc845a76_0
  - charset-normalizer=3.4.1=pyhd8ed1ab_0
  - chex=0.1.88=pyhd8ed1ab_1
  - clang=18.1.8=default_h474c9e2_8
  - clang-18=18.1.8=default_hf90f093_8
  - clang_impl_osx-arm64=18.1.8=h2ae9ea5_24
  - clang_osx-arm64=18.1.8=h07b0088_24
  - clangxx=18.1.8=default_h1ffe849_8
  - clangxx_impl_osx-arm64=18.1.8=h555f467_24
  - clangxx_osx-arm64=18.1.8=h07b0088_24
  - click=8.1.8=pyh707e725_0
  - cloudpickle=3.1.1=pyhd8ed1ab_0
  - colorama=0.4.6=pyhd8ed1ab_1
  - comm=0.2.2=pyhd8ed1ab_1
  - compiler-rt=18.1.8=h856b3c1_1
  - compiler-rt_osx-arm64=18.1.8=h832e737_1
  - cons=0.4.6=pyhd8ed1ab_1
  - contourpy=1.3.1=py313h0ebd0e5_0
  - cpython=3.13.2=py313hd8ed1ab_101
  - cycler=0.12.1=pyhd8ed1ab_1
  - dask-core=2025.3.0=pyhd8ed1ab_0
  - debugpy=1.8.13=py313h928ef07_0
  - decorator=5.2.1=pyhd8ed1ab_0
  - defusedxml=0.7.1=pyhd8ed1ab_0
  - epoxy=1.5.10=h1c322ee_1
  - etils=1.12.2=pyhd8ed1ab_0
  - etuples=0.3.9=pyhd8ed1ab_1
  - exceptiongroup=1.2.2=pyhd8ed1ab_1
  - executing=2.1.0=pyhd8ed1ab_1
  - fastprogress=1.0.3=pyhd8ed1ab_1
  - filelock=3.18.0=pyhd8ed1ab_0
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=h77eed37_3
  - fontconfig=2.15.0=h1383a14_1
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - fonttools=4.57.0=py313ha9b7d5b_0
  - fqdn=1.5.1=pyhd8ed1ab_1
  - freetype=2.13.3=h1d14073_0
  - fribidi=1.0.10=h27ca646_0
  - frozenlist=1.5.0=py313ha9b7d5b_1
  - fsspec=2025.3.2=pyhd8ed1ab_0
  - gast=0.4.0=pyh9f0ad1d_0
  - gdk-pixbuf=2.42.12=h7ddc832_0
  - gflags=2.2.2=hf9b8971_1005
  - glib-tools=2.84.0=h1dc7a0c_0
  - glog=0.7.1=heb240a5_0
  - gmp=6.3.0=h7bae524_2
  - gmpy2=2.1.5=py313h2cdc120_3
  - graphite2=1.3.13=hebf3989_1003
  - graphviz=12.2.1=hff64154_1
  - gtk3=3.24.43=h07173f4_5
  - gts=0.7.6=he42f4ea_4
  - h11=0.14.0=pyhd8ed1ab_1
  - h2=4.2.0=pyhd8ed1ab_0
  - h5netcdf=1.6.1=pyhd8ed1ab_0
  - h5py=3.13.0=nompi_py313hcdf59df_100
  - harfbuzz=11.0.0=hb72c1af_0
  - hdf5=1.14.3=nompi_ha698983_109
  - hicolor-icon-theme=0.17=hce30654_2
  - hpack=4.1.0=pyhd8ed1ab_0
  - html5lib=1.1=pyhd8ed1ab_2
  - httpcore=1.0.7=pyh29332c3_1
  - httpx=0.28.1=pyhd8ed1ab_0
  - huggingface_hub=0.30.1=pyhd8ed1ab_0
  - hyperframe=6.1.0=pyhd8ed1ab_0
  - icu=75.1=hfee45f7_0
  - idna=3.10=pyhd8ed1ab_1
  - importlib-metadata=8.6.1=pyha770c72_0
  - importlib_resources=6.5.2=pyhd8ed1ab_0
  - ipydatagrid=1.4.0=pyhd8ed1ab_1
  - ipykernel=6.29.5=pyh57ce528_0
  - ipython=9.0.2=pyhfb0248b_0
  - ipython_pygments_lexers=1.1.1=pyhd8ed1ab_0
  - ipywidgets=8.1.5=pyhd8ed1ab_1
  - isoduration=20.11.0=pyhd8ed1ab_1
  - jax=0.5.2=pyhd8ed1ab_0
  - jaxlib=0.5.2=cpu_py313ha57edf9_1
  - jaxopt=0.8.3=pyhd8ed1ab_0
  - jedi=0.19.2=pyhd8ed1ab_1
  - jinja2=3.1.6=pyhd8ed1ab_0
  - jmespath=1.0.1=pyhd8ed1ab_1
  - jplephem=2.21=pyh9b8db34_1
  - json5=0.12.0=pyhd8ed1ab_0
  - jsonpointer=3.0.0=py313h8f79df9_1
  - jsonschema=4.23.0=pyhd8ed1ab_1
  - jsonschema-specifications=2024.10.1=pyhd8ed1ab_1
  - jsonschema-with-format-nongpl=4.23.0=hd8ed1ab_1
  - jupyter-lsp=2.2.5=pyhd8ed1ab_1
  - jupyter_client=8.6.3=pyhd8ed1ab_1
  - jupyter_core=5.7.2=pyh31011fe_1
  - jupyter_events=0.12.0=pyh29332c3_0
  - jupyter_server=2.15.0=pyhd8ed1ab_0
  - jupyter_server_terminals=0.5.3=pyhd8ed1ab_1
  - jupyterlab=4.3.6=pyhd8ed1ab_0
  - jupyterlab_pygments=0.3.0=pyhd8ed1ab_2
  - jupyterlab_server=2.27.3=pyhd8ed1ab_1
  - jupyterlab_widgets=3.0.13=pyhd8ed1ab_1
  - kiwisolver=1.4.7=py313hf9c7212_0
  - krb5=1.21.3=h237132a_0
  - lcms2=2.17=h7eeda09_0
  - ld64_osx-arm64=951.9=hb6b49e2_6
  - lerc=4.0.0=h9a09cb3_0
  - libabseil=20250127.1=cxx17_h07bc746_0
  - libaec=1.1.3=hebf3989_0
  - libarrow=19.0.1=hac3dc41_6_cpu
  - libarrow-acero=19.0.1=hf07054f_6_cpu
  - libarrow-dataset=19.0.1=hf07054f_6_cpu
  - libarrow-substrait=19.0.1=he749cb8_6_cpu
  - libblas=3.9.0=31_h10e41b3_openblas
  - libbrotlicommon=1.1.0=hd74edd7_2
  - libbrotlidec=1.1.0=hd74edd7_2
  - libbrotlienc=1.1.0=hd74edd7_2
  - libcblas=3.9.0=31_hb3479ef_openblas
  - libclang-cpp18.1=18.1.8=default_hf90f093_8
  - libcrc32c=1.1.2=hbdafb3b_0
  - libcurl=8.13.0=h73640d1_0
  - libcxx=20.1.2=ha82da77_0
  - libcxx-devel=18.1.8=h6dc3340_8
  - libdeflate=1.23=hec38601_0
  - libedit=3.1.20250104=pl5321hafb1f1b_0
  - libev=4.33=h93a5062_2
  - libevent=2.1.12=h2757513_1
  - libexpat=2.7.0=h286801f_0
  - libffi=3.4.6=h1da3d7d_1
  - libgd=2.3.3=hb2c3a21_11
  - libgfortran=14.2.0=heb5dd2a_105
  - libgfortran5=14.2.0=h2c44a93_105
  - libglib=2.84.0=hdff4504_0
  - libgoogle-cloud=2.36.0=h9484b08_1
  - libgoogle-cloud-storage=2.36.0=h7081f7f_1
  - libgrpc=1.71.0=hf667ad3_0
  - libiconv=1.18=hfe07756_1
  - libintl=0.23.1=h493aca8_0
  - libjpeg-turbo=3.0.0=hb547adb_1
  - liblapack=3.9.0=31_hc9a63f6_openblas
  - liblapacke=3.9.0=31_hbb7bcf8_openblas
  - libllvm18=18.1.8=hc4b4ae8_3
  - liblzma=5.8.1=h39f12f2_0
  - libmpdec=4.0.0=h99b78c6_0
  - libnghttp2=1.64.0=h6d7220d_0
  - libopenblas=0.3.29=openmp_hf332438_0
  - libopentelemetry-cpp=1.19.0=h0181452_0
  - libopentelemetry-cpp-headers=1.19.0=hce30654_0
  - libparquet=19.0.1=h636d7b7_6_cpu
  - libpng=1.6.47=h3783ad8_0
  - libprotobuf=5.29.3=hccd9074_0
  - libre2-11=2024.07.02=hd41c47c_3
  - librsvg=2.58.4=h266df6f_3
  - libsodium=1.0.20=h99b78c6_0
  - libsqlite=3.49.1=h3f77e49_2
  - libssh2=1.11.1=h9cc3647_0
  - libthrift=0.21.0=h64651cc_0
  - libtiff=4.7.0=h551f018_3
  - libtorch=2.6.0=cpu_generic_hb48c3f1_2
  - libutf8proc=2.10.0=hda25de7_0
  - libuv=1.50.0=h5505292_0
  - libwebp-base=1.5.0=h2471fea_0
  - libxcb=1.17.0=hdb1d25a_0
  - libxml2=2.13.7=h52572c6_1
  - libzlib=1.3.1=h8359307_2
  - llvm-openmp=20.1.2=hdb05f8b_0
  - llvm-tools=18.1.8=hc4b4ae8_3
  - llvm-tools-18=18.1.8=hc4b4ae8_3
  - llvmdev=18.1.8=hc4b4ae8_3
  - locket=1.0.0=pyhd8ed1ab_0
  - logical-unification=0.4.6=pyhd8ed1ab_0
  - lz4-c=1.10.0=h286801f_1
  - macosx_deployment_target_osx-arm64=11.0=h6553868_2
  - markdown-it-py=3.0.0=pyhd8ed1ab_1
  - markupsafe=3.0.2=py313ha9b7d5b_1
  - matplotlib-base=3.10.1=py313haaf02c0_0
  - matplotlib-inline=0.1.7=pyhd8ed1ab_1
  - mdurl=0.1.2=pyhd8ed1ab_1
  - minikanren=1.0.3=pyhd8ed1ab_1
  - mistune=3.1.3=pyh29332c3_0
  - ml_dtypes=0.5.1=py313h668b085_0
  - mpc=1.3.1=h8f1351a_1
  - mpfr=4.2.1=hb693164_3
  - mpmath=1.3.0=pyhd8ed1ab_1
  - multidict=6.3.2=py313h6347b5a_0
  - multipledispatch=0.6.0=pyhd8ed1ab_1
  - munkres=1.1.4=pyh9f0ad1d_0
  - nbclient=0.10.2=pyhd8ed1ab_0
  - nbconvert-core=7.16.6=pyh29332c3_0
  - nbformat=5.10.4=pyhd8ed1ab_1
  - ncurses=6.5=h5e97a16_3
  - nest-asyncio=1.6.0=pyhd8ed1ab_1
  - networkx=3.4.2=pyh267e887_2
  - nlohmann_json=3.11.3=h00cdb27_1
  - nomkl=1.0=h5ca1d4c_0
  - notebook=7.3.3=pyhd8ed1ab_0
  - notebook-shim=0.2.4=pyhd8ed1ab_1
  - numpy=2.2.4=py313h41a2e72_0
  - numpyro=0.18.0=pyhd8ed1ab_0
  - nutpie=0.14.3=py313hdde674f_0
  - openblas=0.3.29=openmp_hea878ba_0
  - openjpeg=2.5.3=h8a3d83b_0
  - openssl=3.4.1=h81ee809_0
  - opt_einsum=3.4.0=pyhd8ed1ab_1
  - optax=0.2.4=pyhd8ed1ab_1
  - optree=0.14.1=py313h0ebd0e5_1
  - orc=2.1.1=hd90e43c_1
  - overrides=7.7.0=pyhd8ed1ab_1
  - packaging=24.2=pyhd8ed1ab_2
  - pandas=2.2.3=py313h47b39a6_1
  - pandocfilters=1.5.0=pyhd8ed1ab_0
  - pango=1.56.3=h5fd7515_1
  - parso=0.8.4=pyhd8ed1ab_1
  - partd=1.4.2=pyhd8ed1ab_0
  - pcre2=10.44=h297a79d_2
  - pexpect=4.9.0=pyhd8ed1ab_1
  - pickleshare=0.7.5=pyhd8ed1ab_1004
  - pillow=11.1.0=py313hb37fac4_0
  - pip=25.0.1=pyh145f28c_0
  - pixman=0.44.2=h2f9eb0b_0
  - pkgutil-resolve-name=1.3.10=pyhd8ed1ab_2
  - platformdirs=4.3.7=pyh29332c3_0
  - prometheus-cpp=1.3.0=h0967b3e_0
  - prometheus_client=0.21.1=pyhd8ed1ab_0
  - prompt-toolkit=3.0.50=pyha770c72_0
  - propcache=0.2.1=py313ha9b7d5b_1
  - psutil=7.0.0=py313h90d716c_0
  - pthread-stubs=0.4=hd74edd7_1002
  - ptyprocess=0.7.0=pyhd8ed1ab_1
  - pure_eval=0.2.3=pyhd8ed1ab_1
  - py2vega=0.6.1=pyhd8ed1ab_0
  - pyarrow=19.0.1=py313h39782a4_0
  - pyarrow-core=19.0.1=py313hf9431ad_0_cpu
  - pybind11=2.13.6=pyh1ec8472_2
  - pybind11-global=2.13.6=pyh415d2e4_2
  - pycparser=2.22=pyh29332c3_1
  - pyerfa=2.0.1.5=py313h46657e6_0
  - pygments=2.19.1=pyhd8ed1ab_0
  - pymc=5.22.0=hd8ed1ab_0
  - pymc-base=5.22.0=pyhd8ed1ab_0
  - pyobjc-core=11.0=py313hb6afeec_0
  - pyobjc-framework-cocoa=11.0=py313hb6afeec_0
  - pyparsing=3.2.3=pyhd8ed1ab_1
  - pysocks=1.7.1=pyha55dd90_7
  - pytensor=2.30.2=py313h3c577dd_0
  - pytensor-base=2.30.2=np2py313he581748_0
  - python=3.13.2=h81fe080_101_cp313
  - python-dateutil=2.9.0.post0=pyhff2d567_1
  - python-fastjsonschema=2.21.1=pyhd8ed1ab_0
  - python-graphviz=0.20.3=pyh91182bf_2
  - python-json-logger=2.0.7=pyhd8ed1ab_0
  - python-tzdata=2025.2=pyhd8ed1ab_0
  - python_abi=3.13=6_cp313
  - pytorch=2.6.0=cpu_generic_py313_h386d6f0_2
  - pytz=2024.1=pyhd8ed1ab_0
  - pyyaml=6.0.2=py313ha9b7d5b_2
  - pyzmq=26.4.0=py313he6960b1_0
  - qhull=2020.2=h420ef59_5
  - re2=2024.07.02=h6589ca4_3
  - readline=8.2=h1d1bf99_2
  - referencing=0.36.2=pyh29332c3_0
  - requests=2.32.3=pyhd8ed1ab_1
  - rfc3339-validator=0.1.4=pyhd8ed1ab_1
  - rfc3986-validator=0.1.1=pyh9f0ad1d_0
  - rich=14.0.0=pyh29332c3_0
  - rpds-py=0.24.0=py313hb5fa170_0
  - s3fs=2025.3.2=pyhd8ed1ab_0
  - safetensors=0.5.3=py313hdde674f_0
  - scipy=1.15.2=py313h9a24e0a_0
  - send2trash=1.8.3=pyh31c8845_1
  - setuptools=78.1.0=pyhff2d567_0
  - sigtool=0.1.3=h44b9a77_0
  - six=1.17.0=pyhd8ed1ab_0
  - sleef=3.8=h8391f65_0
  - snappy=1.2.1=h98b9ce2_1
  - sniffio=1.3.1=pyhd8ed1ab_1
  - sortedcontainers=2.4.0=pyhd8ed1ab_1
  - soupsieve=2.5=pyhd8ed1ab_1
  - stack_data=0.6.3=pyhd8ed1ab_1
  - sympy=1.13.3=pyh2585a3b_105
  - tapi=1300.6.5=h03f4b80_0
  - terminado=0.18.1=pyh31c8845_0
  - threadpoolctl=3.6.0=pyhecae5ae_0
  - tinycss2=1.4.0=pyhd8ed1ab_0
  - tk=8.6.13=h5083fa2_1
  - tomli=2.2.1=pyhd8ed1ab_1
  - toolz=1.0.0=pyhd8ed1ab_1
  - tornado=6.4.2=py313h90d716c_0
  - tqdm=4.67.1=pyhd8ed1ab_1
  - traitlets=5.14.3=pyhd8ed1ab_1
  - traittypes=0.2.1=pyh9f0ad1d_2
  - types-python-dateutil=2.9.0.20241206=pyhd8ed1ab_0
  - typing-extensions=4.13.1=hf5ce1d7_0
  - typing_extensions=4.13.1=pyh29332c3_0
  - typing_utils=0.1.0=pyhd8ed1ab_1
  - tzdata=2025b=h78e105d_0
  - uri-template=1.3.0=pyhd8ed1ab_1
  - urllib3=2.3.0=pyhd8ed1ab_0
  - wcwidth=0.2.13=pyhd8ed1ab_1
  - webcolors=24.11.1=pyhd8ed1ab_0
  - webencodings=0.5.1=pyhd8ed1ab_3
  - websocket-client=1.8.0=pyhd8ed1ab_1
  - widgetsnbextension=4.0.13=pyhd8ed1ab_1
  - wrapt=1.17.2=py313h90d716c_0
  - xarray=2025.3.1=pyhd8ed1ab_0
  - xarray-einstats=0.8.0=pyhd8ed1ab_1
  - xorg-libxau=1.0.12=h5505292_0
  - xorg-libxdmcp=1.1.5=hd74edd7_0
  - yaml=0.2.5=h3422bc3_2
  - yarl=1.18.3=py313ha9b7d5b_1
  - zeromq=4.3.5=hc1bb282_7
  - zipp=3.21.0=pyhd8ed1ab_1
  - zlib=1.3.1=h8359307_2
  - zstandard=0.23.0=py313h90d716c_1
  - zstd=1.5.7=h6491c7d_2

@maresb
Copy link
Contributor

maresb commented Apr 6, 2025

Thanks so much @astrokang for all the detail!

I see that llvmdev provides a symlink lib/libLTO.dylib to lib/libLTO.18.1.dylib, which is provided by libllvm18. Now the question is: why isn't this being found by the compiler?

I can think of two likely hypotheses off the top of my head:

  1. The conda-forge libLTO.dylib is valid, but due to some misconfiguration or missing flags, it's not being detected
  2. The conda-forge libLTO.dylib is invalid and that's why it's not being detected

I'm no expert in C compilation, but depending on how adventurous you're feeling, you might be able to figure out the command it's running, and find a minimal example that's independent of PyTensor that we could submit to the conda-forge feedstock.

@maresb
Copy link
Contributor

maresb commented Apr 6, 2025

Many thanks to @corneliusroemer for raising the visibility of this issue by posting it to the conda-forge zulip!

@maresb
Copy link
Contributor

maresb commented Apr 7, 2025

I suspect that this is an activation issue. I received another report that this works on JupyterLab but not VS Code.

I bet one of two things is going on:

  1. JupyterLab isn't properly activating the environment, leading to a fallback to the system clang. In this case, JupyterLab screws up but gets lucky, and VS Code is doing the right thing, but unfortunately fails because the conda-forge libraries are messed up.
  2. The conda-forge libraries are good, but VS Code isn't properly activating the environment, leading to Conda's clang being unable to locate libLTO.dylib, while in JupyterLab everything's fine.

It would be helpful if you could report:

  1. What IDE are you using: JupyterLab, VS Code, or something else?
  2. Do you see conda-forge-related environment variables in os.environ?

@astrokang
Copy link
Author

THX for @maresb's more information!

I'm using VS Code as my IDE. However, I have run the same code in JupyterLab, and it also throws the same error. So I would like to confirm: under what exact environment configuration does it work in the reported JupyterLab, as you mentioned? 👀

For your suggestions, I checked the environment variables using os.environ by running the following code:

import os
for key, value in os.environ.items():
    if "CONDA" in key or "conda-forge" in value:
        print(f"{key}: {value}")

and it returns:

CONDA_BACKUP_LALSIMULATION_DATADIR: empty
CONDA_BACKUP_LAL_DATADIR: empty
CONDA_DEFAULT_ENV: test_env
CONDA_EXE: /Users/dendrophile/opt/anaconda3/bin/conda
CONDA_PREFIX: /Users/dendrophile/miniconda3/envs/test_env
CONDA_PROMPT_MODIFIER: (test_env) 
CONDA_PYTHON_EXE: /Users/dendrophile/opt/anaconda3/bin/python
CONDA_SHLVL: 2
INFOPATH: /opt/homebrew/share/info:
LD_LIBRARY_PATH: /lib:
PATH: /Users/dendrophile/miniconda3/envs/test_env/bin:/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.1.0/bin:/Users/dendrophile/miniconda3/envs/test_env/bin:/Users/dendrophile/opt/anaconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/TeX/texbin:/Applications/VMware Fusion.app/Contents/Public:/Users/dendrophile/.orbstack/bin
VSCODE_CODE_CACHE_PATH: /Users/dendrophile/Library/Application Support/Code/CachedData/4437686ffebaf200fa4a6e6e67f735f3edf24ada
GSETTINGS_SCHEMA_DIR_CONDA_BACKUP: 
CONDA_TOOLCHAIN_BUILD: arm64-apple-darwin20.0.0
CONDA_SYSROOT_osx_arm64_BACKUP_CMAKE_ARGS: -DCMAKE_AR=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CONDA_TOOLCHAIN_HOST: arm64-apple-darwin20.0.0
_CE_CONDA: 
CONDA_PREFIX_1: /Users/dendrophile/opt/anaconda3
CONDA_ROOT: /Users/dendrophile/opt/anaconda3
CONDA_SYSROOT_osx_arm64_BACKUP_CPPFLAGS: -D_FORTIFY_SOURCE=2 -isystem /Users/dendrophile/miniconda3/envs/test_env/include
_CONDA_PYTHON_SYSCONFIGDATA_NAME: _sysconfigdata_arm64_apple_darwin20_0_0
CMAKE_PREFIX_PATH: :/Users/dendrophile/miniconda3/envs/test_env

So, it seems the Conda environment is properly activated in VS Code:

  • CONDA_DEFAULT_ENV is set correctly (test_env)
  • CONDA_PREFIX and PATH point to the right location
  • Several other CONDA_* variables are also present

However, I do not see any conda-forge specific paths in os.environ.

To further rule out IDE-specific issues, I also checked the environment variables in JupyterLab. Here are some relevant parts of os.environ from JupyterLab:

PATH: /usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.1.0/bin:/Users/dendrophile/miniconda3/envs/test_env/bin:/Users/dendrophile/opt/anaconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/TeX/texbin:/Applications/VMware Fusion.app/Contents/Public:/Users/dendrophile/.orbstack/bin
INFOPATH: /opt/homebrew/share/info:
LD_LIBRARY_PATH: /lib:
DYLD_LIBRARY_PATH: /lib:
CONDA_EXE: /Users/dendrophile/miniconda3/bin/conda
_CE_CONDA: 
CONDA_PYTHON_EXE: /Users/dendrophile/miniconda3/bin/python
CONDA_SHLVL: 3
CONDA_PREFIX: /Users/dendrophile/miniconda3/envs/test_env
CONDA_DEFAULT_ENV: test_env
CONDA_PROMPT_MODIFIER: (test_env) 
CONDA_PREFIX_1: /Users/dendrophile/opt/anaconda3
CONDA_PREFIX_2: /Users/dendrophile/miniconda3
CONDA_BACKUP_HOST: Y_C_King
CONDA_TOOLCHAIN_HOST: arm64-apple-darwin20.0.0
CONDA_TOOLCHAIN_BUILD: arm64-apple-darwin20.0.0
_CONDA_PYTHON_SYSCONFIGDATA_NAME: _sysconfigdata_arm64_apple_darwin20_0_0
CMAKE_PREFIX_PATH: :/Users/dendrophile/miniconda3/envs/test_env
CONDA_SYSROOT_osx_arm64_BACKUP_CMAKE_ARGS: -DCMAKE_AR=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/dendrophile/miniconda3/envs/test_env/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CONDA_SYSROOT_osx_arm64_BACKUP_CPPFLAGS: -D_FORTIFY_SOURCE=2 -isystem /Users/dendrophile/miniconda3/envs/test_env/include
GSETTINGS_SCHEMA_DIR_CONDA_BACKUP: 

So it seems both environments are correctly set up, yet the issue persists.

Let me know if you need any more tests—I’m happy to help! 😃

@knods3k
Copy link

knods3k commented Apr 7, 2025

I have had the exact same issue, coming from issue #1347 I'm using VS Code. The issue arises with both regular .ipynb notebook files and interactive sessions.
It's indeed resolved by deleting the conda-installed clang compiler using conda remove --force clang clangxx -n pymc_env.
The following, conda related variables are in os.environ:

CONDA_DEFAULT_ENV: prob
CONDA_EXE: /opt/homebrew/Caskroom/miniconda/base/bin/conda
CONDA_PREFIX: /opt/homebrew/Caskroom/miniconda/base/envs/prob
CONDA_PROMPT_MODIFIER: (prob)
CONDA_PYTHON_EXE: /opt/homebrew/Caskroom/miniconda/base/bin/python
CONDA_SHLVL: 2
CONDA_BACKUP_LDFLAGS: -L/opt/homebrew/opt
CONDA_TOOLCHAIN_BUILD: arm64-apple-darwin20.0.0
_CONDA_PYTHON_SYSCONFIGDATA_NAME: _sysconfigdata_arm64_apple_darwin20_0_0
CONDA_ROOT: /opt/homebrew/Caskroom/miniconda/base
GSETTINGS_SCHEMA_DIR_CONDA_BACKUP:
CONDA_TOOLCHAIN_HOST: arm64-apple-darwin20.0.0
CONDA_SYSROOT_osx_arm64_BACKUP_CPPFLAGS: -D_FORTIFY_SOURCE=2 -isystem /opt/homebrew/Caskroom/miniconda/base/envs/prob/include -I/opt/homebrew/include
CONDA_SYSROOT_osx_arm64_BACKUP_CMAKE_ARGS: -DCMAKE_AR=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/opt/homebrew/Caskroom/miniconda/base/envs/prob/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CONDA_BACKUP_CPPFLAGS: -I/opt/homebrew/include
CONDA_PREFIX_1: /opt/homebrew/Caskroom/miniconda/base

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants