I keep getting the following error message, I am running code on a cluster
Python Code
import stan
import ctypes
libgcc_s = ctypes.CDLL('libgcc_s.so.1')
coin_dat = {'n': 100,'y': 61}
with open('coin_code.stan', 'r') as file:
coin_code = file.read()
fit = stan.build(coin_code, data=coin_dat)
print('fit', fit)
STAN CODE
data {
int<lower=0> n; // number of tosses
int<lower=0> y; // number of heads
}
transformed data {}
parameters {
real<lower=0, upper=1> p;
}
transformed parameters {}
model {
p ~ beta(2, 2);
y ~ binomial(n, p);
}
generated quantities {}
OUTPUT
Building: 142.6s, done.Messages from stanc:
Warning: The parameter p has 2 priors.
ERROR Error handling request web_protocol.py:405
Traceback (most recent call last):
File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/aiohttp/web_protocol.py", line 435, in
_handle_request
resp = await request_handler(request)
File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/projappl/project_2005952/Challenge/Task_1/pip/lib/python3.8/site-packages/httpstan/views.py", line 253, in
handle_show_params
services_module = httpstan.models.import_services_extension_module(model_name)
File "/projappl/project_2005952/Challenge/Task_1/pip/lib/python3.8/site-packages/httpstan/models.py", line 90, in
import_services_extension_module
module: ModuleType = importlib.util.module_from_spec(spec) # type: ignore
File "<frozen importlib._bootstrap>", line 556, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1166, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError:
/users/irfan21h/.cache/httpstan/4.10.1/models/ih7rdrg7/stan_services_model_ih7rdrg7.cpython-38-x86_64-linux-gnu.so:
undefined symbol: _ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev
[11:04:05] INFO 127.0.0.1 [13/May/2024:08:04:04 +0000] "POST /v1/models/ih7rdrg7/params HTTP/1.1" 500 244 "-" "Python/3.8 aiohttp/3.8.1" web_log.py:206