I am using a Dell Precision 3580 Running Widows 10 with an X-64 processor. Because of how IT needs things to be done at my job, all of the whl files have to be saved onto a remote server and installed from there so Conda was not a viable option and I elected to used PDM to manage my environment. I am also trying to use Juypter Interactive windows on VScode.
With the following Code
> # %%
> import pandas as pd
> import datetime as dt
> import numpy as np
> import seaborn as sns
> import matplotlib
> import matplotlib.pyplot as plt
> import pymc as pm
> import arviz as az
> from scipy import stats
> from pytensor import shared
> import pytensor.tensor as at
>
> # %%
> penguins = sns.load_dataset('penguins')
> # Subset to the columns needed
> missing_data = penguins.isnull()[
> ["bill_length_mm", "flipper_length_mm",
> "sex", "body_mass_g"]
> ].any(axis=1)
> # Drop rows with any missing data
> penguins = penguins.loc[~missing_data]
>
> summary_stats = (penguins.loc[:, ["species", "body_mass_g"]]
> .groupby("species")
> .agg(["mean", "std", "count"]))
>
> species_one_hot = (pd.get_dummies(penguins['species'],\
> columns=['species'], prefix='', prefix_sep=''))
>
> # %%
> with pm.Model() as model_penguin_mass_all_species:
> # Note the addition of the shape parameter
> σ = pm.HalfStudentT("σ", 100, 2000, shape=3)
> μ = pm.Normal("μ", 4000, 3000, shape=3)
> mass = pm.Normal("mass",
> mu=μ.dot(species_one_hot.T),
> sigma=σ.dot(species_one_hot.T),
> observed=penguins["body_mass_g"])
>
> trace = pm.sample()
I am getting the error message below in my interactive window:
> ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
> ERROR (pytensor.graph.rewriting.basic): node: DropDims{axis=0}([3])
> ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
> ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\graph\rewriting\basic.py", line 1919, in process_node
> replacements = node_rewriter.transform(fgraph, node)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\graph\rewriting\basic.py", line 1081, in transform
> return self.fn(fgraph, node)
> ^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\tensor\rewriting\basic.py", line 1120, in constant_folding
> thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\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 "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\op.py", line 84, in make_c_thunk
> outputs = cl.make_thunk(
> ^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1190, in make_thunk
> cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
> ^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1110, in __compile__
> thunk, module = self.cthunk_factory(
> ^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1632, in cthunk_factory
> module = cache.module_from_key(key=key, lnk=self)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\cmodule.py", line 1250, in module_from_key
> module = lnk.compile_cmodule(location)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1533, in compile_cmodule
> module = c_compiler.compile_str(
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\cmodule.py", line 2651, in compile_str
> raise CompileError(
> pytensor.link.c.exceptions.CompileError: Compilation failed (return status=1):
> "c:\Rtools\mingw_32\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\WYoung1\AppData\Python\.venv\Lib\site-packages\numpy\core\include" -I"C:\Program Files\Python312\include" -I"c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\c_code" -L"C:\Program Files\Python312\libs" -L"C:\Program Files\Python312" -o "C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmpv3xbclhq\mfeba4d434591def33153ec442edc27a735fd9fa46fd5f1fae8efd4f490539b0a.pyd" "C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmpv3xbclhq\mod.cpp" "C:\Program Files\Python312\python312.dll"
> C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmpv3xbclhq\mod.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
> #include <Python.h>
> ^
>
>
> ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
> ERROR (pytensor.graph.rewriting.basic): node: DropDims{axis=0}([3])
> ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
> ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\graph\rewriting\basic.py", line 1919, in process_node
> replacements = node_rewriter.transform(fgraph, node)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\graph\rewriting\basic.py", line 1081, in transform
> return self.fn(fgraph, node)
> ^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\tensor\rewriting\basic.py", line 1120, in constant_folding
> thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\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 "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\op.py", line 84, in make_c_thunk
> outputs = cl.make_thunk(
> ^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1190, in make_thunk
> cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
> ^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1110, in __compile__
> thunk, module = self.cthunk_factory(
> ^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1632, in cthunk_factory
> module = cache.module_from_key(key=key, lnk=self)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\cmodule.py", line 1250, in module_from_key
> module = lnk.compile_cmodule(location)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1533, in compile_cmodule
> module = c_compiler.compile_str(
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\cmodule.py", line 2651, in compile_str
> raise CompileError(
> pytensor.link.c.exceptions.CompileError: Compilation failed (return status=1):
> "c:\Rtools\mingw_32\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\WYoung1\AppData\Python\.venv\Lib\site-packages\numpy\core\include" -I"C:\Program Files\Python312\include" -I"c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\c_code" -L"C:\Program Files\Python312\libs" -L"C:\Program Files\Python312" -o "C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmpeeixojr7\mfeba4d434591def33153ec442edc27a735fd9fa46fd5f1fae8efd4f490539b0a.pyd" "C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmpeeixojr7\mod.cpp" "C:\Program Files\Python312\python312.dll"
> C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmpeeixojr7\mod.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
> #include <Python.h>
> ^
>
>
> ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
>
> You can find the C code in this temporary file: C:\Users\WYoung1\AppData\Local\Temp\pytensor_compilation_error_z7i6yci8
>
> You can find the C code in this temporary file: C:\Users\WYoung1\AppData\Local\Temp\pytensor_compilation_error_qu33gcou
>
> You can find the C code in this temporary file: C:\Users\WYoung1\AppData\Local\Temp\pytensor_compilation_error_76wbjtxe
> ERROR (pytensor.graph.rewriting.basic): node: DropDims{axis=0}([3])
> ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
> ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\graph\rewriting\basic.py", line 1919, in process_node
> replacements = node_rewriter.transform(fgraph, node)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\graph\rewriting\basic.py", line 1081, in transform
> return self.fn(fgraph, node)
> ^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\tensor\rewriting\basic.py", line 1120, in constant_folding
> thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\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 "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\op.py", line 84, in make_c_thunk
> outputs = cl.make_thunk(
> ^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1190, in make_thunk
> cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
> ^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1110, in __compile__
> thunk, module = self.cthunk_factory(
> ^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1632, in cthunk_factory
> module = cache.module_from_key(key=key, lnk=self)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\cmodule.py", line 1250, in module_from_key
> module = lnk.compile_cmodule(location)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\basic.py", line 1533, in compile_cmodule
> module = c_compiler.compile_str(
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\cmodule.py", line 2651, in compile_str
> raise CompileError(
> pytensor.link.c.exceptions.CompileError: Compilation failed (return status=1):
> "c:\Rtools\mingw_32\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\WYoung1\AppData\Python\.venv\Lib\site-packages\numpy\core\include" -I"C:\Program Files\Python312\include" -I"c:\Users\WYoung1\AppData\Python\.venv\Lib\site-packages\pytensor\link\c\c_code" -L"C:\Program Files\Python312\libs" -L"C:\Program Files\Python312" -o "C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmp32ybresb\mfeba4d434591def33153ec442edc27a735fd9fa46fd5f1fae8efd4f490539b0a.pyd" "C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmp32ybresb\mod.cpp" "C:\Program Files\Python312\python312.dll"
> C:\Users\WYoung1\AppData\Local\PyTensor\compiledir_Windows-10-10.0.19045-SP0-Intel64_Family_6_Model_186_Stepping_2_GenuineIntel-3.12.3-64\tmp32ybresb\mod.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
> #include <Python.h>
> ^
>
>
>
> You can find the C code in this temporary file: C:\Users\WYoung1\AppData\Local\Temp\pytensor_compilation_error_0lbbpua3
Please advise on how I can solve this issue. Package list will follow in a comment to this post.