Visual Studio Code Universal on Mac M-Series Freezing when Importing PyMC

I’m wondering if anyone recently has run into an issue where in Visual Studio Code, the Universal version, on a Mac M-Series computer will freeze when executing import pymc?

I’m using Visual Studio Code 1.88.1 on macOS 14.4.1 with PyMC 5.6.1. I’m using 2 conda environments with Python 3.8.6 and 3.11.8. I have not updated anything recently and I don’t believe I have anything on my machine set to update automatically.

This just started happening a few days ago. One day it worked, the next day it would freeze when I’d try to execute it. Even in the VS Code terminal, if I enter python and then type import pymc it will just hang.

My PyMC code works just fine in the standard Mac terminal, iTerm, JupyterLab, Spyder, and Visual Studio Code for Mac (Intel version).

The stack trace I get when I hit Ctrl-C in the VSCode terminal is:
(ISYE6420) (base) XXX@XXX-Mac-mini ~ % /Users/xxx/opt/anaconda3/envs/ISYE6420/bin/python /Users/xxx/OMSA/ISYE6420-Bayesian-Statistics/HW6/HW6_Code_Q1.py
^CTraceback (most recent call last):
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/configparser.py”, line 201, in fetch_val_for_key
return self._pytensor_cfg.get(section, option)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/configparser.py”, line 797, in get
d = self._unify_values(section, vars)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/configparser.py”, line 1168, in _unify_values
raise NoSectionError(section) from None
configparser.NoSectionError: No section: ‘blas’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/configparser.py”, line 317, in get
val_str = cls.fetch_val_for_key(self.name, delete_key=delete_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/configparser.py”, line 205, in fetch_val_for_key
raise KeyError(key)
KeyError: ‘blas__ldflags’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/xxx/OMSA/ISYE6420-Bayesian-Statistics/HW6/HW6_Code_Q1.py”, line 3, in
import pymc as pm
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pymc/init.py”, line 47, in
__set_compiler_flags()
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pymc/init.py”, line 30, in __set_compiler_flags
import pytensor
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/init.py”, line 119, in
from pytensor import scalar, tensor
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/tensor/init.py”, line 106, in
from pytensor.tensor import ( # noqa
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/tensor/blas.py”, line 102, in
from pytensor.tensor.blas_headers import blas_header_text, blas_header_version
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/tensor/blas_headers.py”, line 1015, in
if not config.blas__ldflags:
^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/configparser.py”, line 321, in get
val_str = self.default()
^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/link/c/cmodule.py”, line 2833, in default_blas_ldflags
res = try_blas_flag(flags)
^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/link/c/cmodule.py”, line 2006, in try_blas_flag
res = GCC_compiler.try_compile_tmp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/link/c/cmodule.py”, line 2402, in try_compile_tmp
return cls._try_compile_tmp(
^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/link/c/cmodule.py”, line 1881, in _try_compile_tmp
args = cls.compile_args()
^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/link/c/cmodule.py”, line 2310, in compile_args
compilation_result, execution_result = try_march_flag(
^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/link/c/cmodule.py”, line 2041, in try_march_flag
compilation_result, execution_result = GCC_compiler.try_compile_tmp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/link/c/cmodule.py”, line 2402, in try_compile_tmp
return cls._try_compile_tmp(
^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/link/c/cmodule.py”, line 1907, in _try_compile_tmp
out, err, p_ret = output_subprocess_Popen([exe_path])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/site-packages/pytensor/utils.py”, line 213, in output_subprocess_Popen
out = p.communicate()
^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/subprocess.py”, line 1209, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/subprocess.py”, line 2113, in _communicate
ready = selector.select(timeout)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/xxx/opt/anaconda3/envs/ISYE6420/lib/python3.11/selectors.py”, line 415, in select
fd_event_list = self._selector.poll(timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt

CC @lucianopaz