PYMC issues with running a simple model

Awhile back, I made a thread regarding issues with pymc.

The old Thread: Why am I getting a windows error bug? [WinError -1066598273] Windows Error 0xc06d007f

I stopped trying to use it, and now I’m I’m retrying. This is my error

C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\threadpoolctl.py:1226: RuntimeWarning:
Found Intel OpenMP (‘libiomp’) and LLVM OpenMP (‘libomp’) loaded at
the same time. Both libraries are known to be incompatible and this
can cause random crashes or deadlocks on Linux when loaded in the
same Python program.
Using threadpoolctl may cause crashes or deadlocks. For more
information and possible workarounds, please see

warnings.warn(msg, RuntimeWarning)
Initializing NUTS using jitter+adapt_diag…
Problem occurred during compilation with the command line below:
C:/Users/User/anaconda3/envs/pymc_env/Library/mingw-w64/bin/g++.exe -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.26200-SP0-AMD64_Family_26_Model_68_Stepping_0_AuthenticAMD-3.14.2-64\tmp0750m9le\m554d8cc4ad57fe37465b296115316c3a94ba7729ee026d9c157d110766493286.pyd”’ ‘“C:\Users\User\AppData\Local\PyTensor\compiledir_Windows-11-10.0.26200-SP0-AMD64_Family_26_Model_68_Stepping_0_AuthenticAMD-3.14.2-64\tmp0750m9le\mod.cpp”’ ‘“C:\Users\User\anaconda3\envs\pymc_env\python314.dll”’
ERROR (pytensor.link.c.cmodule): [WinError 2] The system cannot find the file specified

We’re in the process of expanding support for the numba backend to give users a way to side-step all of these C compiler related headaches, with the hope of numba eventually being the default.

Does the model run if you add compile_kwargs={'mode':'NUMBA'} to pm.sample ?

Using this in the python console, I get the error below.

with Model() as model: # model specifications in PyMC are wrapped in a with-statement
… # Define priors
… sigma = HalfCauchy(“sigma”, beta=10)
… intercept = Normal(“Intercept”, 0, sigma=20)
… slope = Normal(“slope”, 0, sigma=20)

… # Define likelihood
… likelihood = Normal(“y”, mu=intercept + slope * x, sigma=sigma, observed=y)

… # Inference!
… # draw 3000 posterior samples using NUTS sampling
… idata = pm.sample(3000, compile_kwargs = {‘mode’: ‘NUMBA’})

FileNotFoundError: [WinError 2] The system cannot find the file specified
Apply node that caused the error: Exp(sigma_log__)
Toposort index: 0
Inputs types: [TensorType(float64, shape=())]

Backtrace when the node is created (use PyTensor flag traceback__limit=N to make it longer):
File “C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\pymc\backends\ndarray.py”, line 44, in init
super().init(name, model, vars, test_point, **kwargs)
File “C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\pymc\backends\base.py”, line 166, in init
vars = model.unobserved_value_vars
File “C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\pymc\model\core.py”, line 868, in unobserved_value_vars
untransformed_vars = self.replace_rvs_by_values(transformed_rvs)
File “C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\pymc\model\core.py”, line 1590, in replace_rvs_by_values
return replace_rvs_by_values(
File “C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\pymc\logprob\utils.py”, line 125, in replace_rvs_by_values
for _ in walk(graphs, populate_replacements, bfs=False):
File “C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\pytensor\graph\traversal.py”, line 90, in walk
new_nodes = expand(node)
File “C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\pymc\logprob\utils.py”, line 110, in populate_replacements
value = transform.backward(value, *rv.owner.inputs)
File “C:\Users\User\anaconda3\envs\pymc_env\Lib\site-packages\pymc\logprob\transforms.py”, line 786, in backward
return pt.exp(value)

HINT: Use a linker other than the C linker to print the inputs’ shapes and strides.
HINT: Use the PyTensor flag exception_verbosity=high for a debug print-out and storage map footprint of this Apply node.

Why is windows so goofy with this? Running it on mac is so easy, but unfortunately my good pc specs are on windows.

Try the numba backend as mentioned above

I did. The error I got was the one after Jesse’s message.

Your installation looks broken. I’d go full salt the earth:

  • clear your pytensor cache with pytensor-cache purge
  • clear conda cache with conda clear all
  • delete the pymc_env environment
  • manually go to C:\Users\User\anaconda3\envs and make sure pymc_env is deleted with nothing left over
  • recreate the environment

Given that you’ve had troubles in the past I’d wager you’ve deleted and recreated the environment before. I’ve had issues doing this where some files were left behind, polluting site-packages with empty folders, causing errors. I’d rule this out by taking every possible measure to delete everything.

When you install make sure you’re setting conda-forge and nodefaults as channels so you don’t mix stuff from anaconda and conda-forge. Better yet switch to miniforge to avoid this issue all together (using anaconda adds no value to your workflow and the company engages in some sketchy licensing stuff)

I ran this again using miniconda and the conda forge environment style. I also deleted everytthing anaconda before this.

I got the same error running this:

with Model() as model: # model specifications in PyMC are wrapped in a with-statement
… # Define priors
… sigma = HalfCauchy(“sigma”, beta=10)
… intercept = Normal(“Intercept”, 0, sigma=20)
… slope = Normal(“slope”, 0, sigma=20)

… # Define likelihood
… likelihood = Normal(“y”, mu=intercept + slope * x, sigma=sigma, observed=y)

… # Inference!
… # draw 3000 posterior samples using NUTS sampling
… idata = sample(1000, compile_kwargs = {‘mode’: ‘NUMBA’})

C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\threadpoolctl.py:1226: RuntimeWarning:
Found Intel OpenMP (‘libiomp’) and LLVM OpenMP (‘libomp’) loaded at
the same time. Both libraries are known to be incompatible and this
can cause random crashes or deadlocks on Linux when loaded in the
same Python program.
Using threadpoolctl may cause crashes or deadlocks. For more
information and possible workarounds, please see

warnings.warn(msg, RuntimeWarning)
Initializing NUTS using jitter+adapt_diag…
Problem occurred during compilation with the command line below:
C:/Users/User/anaconda3/envs/pymc_env/Library/mingw-w64/bin/g++.exe -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\miniconda3\envs\pymc_env\Lib\site-packages\numpy_core\include"’ ‘-I"C:\Users\User\miniconda3\envs\pymc_env\include"’ ‘-I"C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\c_code"’ ‘-L"C:\Users\User\miniconda3\envs\pymc_env\libs"’ ‘-L"C:\Users\User\miniconda3\envs\pymc_env"’ -o ‘“C:\Users\User\AppData\Local\PyTensor\compiledir_Windows-11-10.0.26200-SP0-AMD64_Family_26_Model_68_Stepping_0_AuthenticAMD-3.14.2-64\tmpmy5kihm5\m6607515dc44f904457288acd578cd2998920d87a3a70362193d98ee81337b35a.pyd”’ ‘“C:\Users\User\AppData\Local\PyTensor\compiledir_Windows-11-10.0.26200-SP0-AMD64_Family_26_Model_68_Stepping_0_AuthenticAMD-3.14.2-64\tmpmy5kihm5\mod.cpp”’ ‘“C:\Users\User\miniconda3\envs\pymc_env\python314.dll”’
ERROR (pytensor.link.c.cmodule): [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\vm.py”, line 1237, in make_all
node.op.make_thunk(node, storage_map, compute_map, , impl=impl)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\User\miniconda3\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\miniconda3\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\miniconda3\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\miniconda3\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\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\basic.py”, line 1623, in cthunk_factory
module = cache.module_from_key(key=key, lnk=self)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\cmodule.py”, line 1251, in module_from_key
module = lnk.compile_cmodule(location)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\basic.py”, line 1524, in compile_cmodule
module = c_compiler.compile_str(
module_name=mod.code_hash,
…<5 lines>…
preargs=preargs,
)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\cmodule.py”, line 2626, in compile_str
p_out = output_subprocess_Popen(cmd)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\utils.py”, line 191, in output_subprocess_Popen
p = subprocess_Popen(command, **params)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\utils.py”, line 157, in subprocess_Popen
return subprocess.Popen(command, startupinfo=startupinfo, **params)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\subprocess.py”, line 1038, 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\miniconda3\envs\pymc_env\Lib\subprocess.py”, line 1552, 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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 12, in
idata = sample(1000, compile_kwargs = {‘mode’: ‘NUMBA’})
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\sampling\mcmc.py”, line 868, in sample
run, traces = init_traces(
~~~~~~~~~~~^
backend=trace,
^^^^^^^^^^^^^^
…<6 lines>…
tune=tune,
^^^^^^^^^^
)
^
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\backends_init_.py”, line 156, in init_traces
init_trace(
~~~~~~~~~~~^
expected_length=expected_length,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…<5 lines>…
initial_point=initial_point,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\backends_init
.py", line 110, in init_trace
strace = NDArray(model=model, vars=trace_vars, test_point=initial_point)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\backends\ndarray.py”, line 44, in init
super().init(name, model, vars, test_point, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\backends\base.py”, line 174, in init
fn = compile(
inputs=[pytensor.In(v, borrow=True) for v in model.value_vars],
outputs=[pytensor.Out(v, borrow=True) for v in vars],
on_unused_input=“ignore”,
)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\pytensorf.py”, line 963, in compile
pytensor_function = pytensor.function(
inputs,
…<3 lines>…
**kwargs,
)
File "C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\compile\function_init
.py", line 332, in function
fn = pfunc(
params=inputs,
…<12 lines>…
trust_input=trust_input,
)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\compile\function\pfunc.py”, line 464, in pfunc
return orig_function(
inputs,
…<8 lines>…
trust_input=trust_input,
)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\compile\function\types.py”, line 1834, in orig_function
fn = m.create(defaults)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\compile\function\types.py”, line 1718, in create
_fn, _i, _o = self.linker.make_thunk(
~~~~~~~~~~~~~~~~~~~~~~^
input_storage=input_storage_lists, storage_map=storage_map
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\basic.py”, line 248, in make_thunk
return self.make_all(
~~~~~~~~~~~~~^
input_storage=input_storage,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
output_storage=output_storage,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
storage_map=storage_map,
^^^^^^^^^^^^^^^^^^^^^^^^
)[:3]
^
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\vm.py”, line 1246, in make_all
raise_with_op(fgraph, node)
~~~~~~~~~~~~~^^^^^^^^^^^^^^
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\utils.py”, line 526, in raise_with_op
raise exc_value.with_traceback(exc_trace)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\vm.py”, line 1237, in make_all
node.op.make_thunk(node, storage_map, compute_map, , impl=impl)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\User\miniconda3\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\miniconda3\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\miniconda3\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\miniconda3\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\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\basic.py”, line 1623, in cthunk_factory
module = cache.module_from_key(key=key, lnk=self)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\cmodule.py”, line 1251, in module_from_key
module = lnk.compile_cmodule(location)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\basic.py”, line 1524, in compile_cmodule
module = c_compiler.compile_str(
module_name=mod.code_hash,
…<5 lines>…
preargs=preargs,
)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\link\c\cmodule.py”, line 2626, in compile_str
p_out = output_subprocess_Popen(cmd)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\utils.py”, line 191, in output_subprocess_Popen
p = subprocess_Popen(command, **params)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\utils.py”, line 157, in subprocess_Popen
return subprocess.Popen(command, startupinfo=startupinfo, **params)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\subprocess.py”, line 1038, 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\miniconda3\envs\pymc_env\Lib\subprocess.py”, line 1552, 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
Apply node that caused the error: Exp(sigma_log*)
Toposort index: 0
Inputs types: [TensorType(float64, shape=())]

Backtrace when the node is created (use PyTensor flag traceback__limit=N to make it longer):
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\backends\ndarray.py”, line 44, in init
super().init(name, model, vars, test_point, **kwargs)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\backends\base.py”, line 166, in init
vars = model.unobserved_value_vars
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\model\core.py”, line 868, in unobserved_value_vars
untransformed_vars = self.replace_rvs_by_values(transformed_rvs)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\model\core.py”, line 1590, in replace_rvs_by_values
return replace_rvs_by_values(
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\logprob\utils.py”, line 125, in replace_rvs_by_values
for _ in walk(graphs, populate_replacements, bfs=False):
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pytensor\graph\traversal.py”, line 90, in walk
new_nodes = expand(node)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\logprob\utils.py”, line 110, in populate_replacements
value = transform.backward(value, *rv.owner.inputs)
File “C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\pymc\logprob\transforms.py”, line 786, in backward
return pt.exp(value)

HINT: Use a linker other than the C linker to print the inputs’ shapes and strides.
HINT: Use the PyTensor flag exception_verbosity=high for a debug print-out and storage map footprint of this Apply node.

If I’m S.O.L, I can use numpyro, julia, or stan. I don’t want to burden any of you.

Try running with sample(...cores=1), it could be a multiprocessing issue, not a compilation one. Also set pytensor.config.cxx="" to fully disable c compilation.

import pytensor

pytensor.config.cxx=""
... # your code 

One of those changes should be enough

so it ran with both of them. Does this mean I can’t run on multiple cores?

If I try this in positron, it crashes on me and is some error like this:

Python 3.14.2 (Conda: pymc_env) started.

Python 3.14.2 | packaged by conda-forge | (main, Dec 6 2025, 11:17:27) [MSC v.1944 64 bit (AMD64)]

Type ‘copyright’, ‘credits’ or ‘license’ for more information

IPython 8.18.1 – An enhanced Interactive Python. Type ‘?’ for help.

Automatic import reloading for Python is enabled. It can be disabled with the python.enableAutoReload setting.

>>> import pymc as pm

Python 3.14.2 (Conda: pymc_env) exited unexpectedly: exit code -1066598273

I’m just trying to debug at this point, not offering the final solution. Also try to test using terminal or jupyter directly instead of a custom IDE to help pinpoint the source of the problem

Does just one of the changes allow it to run as well?

No. If I do pytensor.config.cxx=“” and cores = 1, it works. If I run it with cores = 2 and IF I DON’T TOUCH pytensor.config.cxx=“”, it doesn’t work. Then the opposite as well doesn’t work.

So you’re seeing windows multiprocessing and c compilation issues on your machine. The multiprocessing issue is a long standing one on windows, although I didn’t hear a complait for a while.The c compilation sounds like a bad installation on your system. Are you sure you running on the right conda environment? You can print sys.executable to see which python it is.

My next suggestion is to leave cxx="" and use sample(..., nuts_sampler="nutpie"). Hopefully that will be able to use multiple cores just fine as it runs on a rust based sampler, not a python one.

You need to install nutpie manually first

I tried installing nutpie the way that the documents for pymc suggest. I get this error

LibMambaUnsatisfiableError: Encountered problems while solving:

  • package nutpie-0.10.0-py310h9a641cc_0 requires python >=3.10,<3.11.0a0, but none of the providers can be installed

Could not solve for environment specs
The following packages are incompatible
├─ nutpie =* * is installable with the potential options
│ ├─ nutpie [0.1.1|0.1.2|…|0.9.2] would require
│ │ └─ python >=3.10,<3.11.0a0 *, which can be installed;
│ ├─ nutpie [0.10.0|0.11.0|…|0.9.2] would require
│ │ └─ python >=3.11,<3.12.0a0 *, which can be installed;
│ ├─ nutpie [0.1.1|0.1.2|…|0.9.2] would require
│ │ └─ python >=3.9,<3.10.0a0 *, which can be installed;
│ ├─ nutpie [0.11.0|0.11.1|…|0.16.4] would require
│ │ └─ python >=3.12,<3.13.0a0 *, which can be installed;
│ ├─ nutpie [0.14.2|0.14.3|…|0.16.4] would require
│ │ └─ python >=3.13,<3.14.0a0 *, which can be installed;
│ └─ nutpie [0.1.1|0.1.2|…|0.5.1] would require
│ └─ python >=3.8,<3.9.0a0 *, which can be installed;
└─ pin on python =3.14 * is not installable because it requires
└─ python =3.14 *, which conflicts with any installable versions previously reported.

Nutpie isn’t yet compatible with python 3.14, can you go with 3.13?

I didn’t have to specify pytensor.config.cxx=“” and it ran with nutpie as the sampler with 4 chains and I specified 4 cores.

This works in the python console, and I fixed it for my vscode.

One final question: So nutpie is pretty fast if it’s written in Rust. If I want to use my gpu for a large dataset, what would the backend be?

C:\Users\User\miniconda3\envs\pymc_env\Lib\site-packages\threadpoolctl.py:1226: RuntimeWarning:
Found Intel OpenMP (‘libiomp’) and LLVM OpenMP (‘libomp’) loaded at
the same time. Both libraries are known to be incompatible and this
can cause random crashes or deadlocks on Linux when loaded in the
same Python program.
Using threadpoolctl may cause crashes or deadlocks. For more
information and possible workarounds, please see

should I be concerned with a message like this?

For GPU on windows you’re out of luck within the PyMC ecosystem for now. We rely on JAX that (which nutpie can handle), but I don’t think JAX on windows supports GPU (or is very well supported even on CPU).

Your next best try would be pytorch backend but that’s too raw still. I would check if there’s another library first, perhaps STAN or Julia like you mentioned