All,
I installed anaconda and pymc according to the usual document the pyMC website suggested. When I run a very simple model, I get the below error. I have googled, unstalled and reinstalled, and I am a total loss. I think pymc is interesting as my research is in Bayesian methodology. If you have any advice I’d greatly appreciate it.
Notes: I ran this in positron, VScode, spyder.
Python Version: 3.13.7
Pymc Version:5.25.1
gcc version: 14.3.0
########################## Model ##################################
size = 100
\# Predictor variable
X1 = np.random.randn(size)
X2 = np.random.randn(size) \* 0.2
\# Simulate outcome variable
Y = alpha + beta\[0\] \* X1 + beta\[1\] \* X2 + rng.normal(size=size) \* sigma
basic_model = pm.Model()
with basic_model:
\# Priors for unknown model parameters
alpha = pm.Normal("alpha", mu=0, sigma=10)
beta = pm.Normal("beta", mu=0, sigma=10, shape=2)
sigma = pm.HalfNormal("sigma", sigma=1)
\# Expected value of outcome
mu = alpha + beta\[0\] \* X1 + beta\[1\] \* X2
\# Likelihood (sampling distribution) of observations
Y_obs = pm.Normal("Y_obs", mu=mu, sigma=sigma, observed=Y)
with basic_model:
idata = pm.sample()
############################# Error #########################################
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: ExpandDims{axis=0}(10)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\graph\\rewriting\\basic.py”, line 1922, in process_node
replacements = node_rewriter.transform(fgraph, node)
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\graph\\rewriting\\basic.py”, line 1086, in transform
return self.fn(fgraph, node)
\~\~\~\~\~\~\~^^^^^^^^^^^^^^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\tensor\\rewriting\\basic.py”, line 1160, in constant_folding
return unconditional_constant_folding.transform(fgraph, node)
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^^^^^^^^^^^^^^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\graph\\rewriting\\basic.py”, line 1086, in transform
return self.fn(fgraph, node)
\~\~\~\~\~\~\~^^^^^^^^^^^^^^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\tensor\\rewriting\\basic.py”, line 1109, in unconditional_constant_folding
thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=\[\])
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\op.py”, line 125, in make_thunk
return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\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 “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\basic.py”, line 1185, in make_thunk
cthunk, module, in_storage, out_storage, error_storage = self.\__compile_\_(
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^
input_storage, output_storage, storage_map, cache
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\basic.py”, line 1102, in \_*compile*\_
thunk, module = self.cthunk_factory(
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^
error_storage,
^^^^^^^^^^^^^^
...<3 lines>...
cache,
^^^^^^
)
^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\basic.py”, line 1613, in cthunk_factory
key = self.cmodule_key()
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\basic.py”, line 1269, in cmodule_key
compile_args=self.compile_args(),
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\basic.py”, line 951, in compile_args
ret += c_compiler.compile_args()
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\cmodule.py”, line 2149, in compile_args
native_lines = get_lines(\[config.cxx, "-march=native", "-E", "-v", "-"\])
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\cmodule.py”, line 2109, in get_lines
p = subprocess_Popen(
cmd,
...<2 lines>...
stdin=subprocess.PIPE,
)
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\utils.py”, line 147, in subprocess_Popen
return subprocess.Popen(command, startupinfo=startupinfo, \*\*params)
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\subprocess.py”, line 1039, in \_*init*\_
self.\_execute_child(args, executable, preexec_fn, close_fds,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pass_fds, cwd, env,
^^^^^^^^^^^^^^^^^^^
...<5 lines>...
gid, gids, uid, umask,
^^^^^^^^^^^^^^^^^^^^^^
start_new_session, process_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\subprocess.py”, line 1554, in \_execute_child
hp, ht, pid, tid = \_winapi.CreateProcess(executable, args,
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~^^^^^^^^^^^^^^^^^^
\# no special security
^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
cwd,
^^^^
startupinfo)
^^^^^^^^^^^^
FileNotFoundError: \[WinError 2\] The system cannot find the file specified
Problem occurred during compilation with the command line below:
/usr/bin/clang++ -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -Wno-c++11-narrowing -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 ‘-I"C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\numpy\\\_core\\include"’ ‘-I"C:\\Users\\User\\anaconda3\\envs\\pymc_env\\include"’ ‘-I"C:\\Users\\User\\anaconda3\\envs\\pymc_env\\Lib\\site-packages\\pytensor\\link\\c\\c_code"’ ‘-L"C:\\Users\\User\\anaconda3\\envs\\pymc_env\\libs"’ ‘-L"C:\\Users\\User\\anaconda3\\envs\\pymc_env"’ -o ‘“C:\\Users\\User\\AppData\\Local\\PyTensor\\compiledir_Windows-11-10.0.26100-SP0-AMD64_Family_26_Model_68_Stepping_0_AuthenticAMD-3.13.7-64\\tmpyftfetsa\\maf0d02fbdfcaf55e62ba8a5e67267798ee89cb10806fd8f5f216a19ab331f072.pyd”’ ‘“C:\\Users\\User\\AppData\\Local\\PyTensor\\compiledir_Windows-11-10.0.26100-SP0-AMD64_Family_26_Model_68_Stepping_0_AuthenticAMD-3.13.7-64\\tmpyftfetsa\\mod.cpp”’ ‘“C:\\Users\\User\\anaconda3\\envs\\pymc_env\\python313.dll”’
Running on PyMC v5.25.1
OSError: \[WinError -1066598273\] Windows Error 0xc06d007f
Cell **In\[2\], line 50**
47 Y_obs = pm.Normal("Y_obs", mu=mu, sigma=sigma, observed=Y)
49 **with** basic_model:
**—> 50** idata = pm.sample()
Show Traceback
Fix
Explain