Submit your innovative use case or inspiring success story to the 2023 Dataiku Frontrunner Awards! LET'S GO

Dataiku compatibility with pystan

amith_yadav
Level 1
Dataiku compatibility with pystan

Hey

We were trying to execute some stan code on dataiku using stan.build and was facing issues. So we wanted a confirmation on whether the pystan is compatible with Dataiku. If compatible, what version of pystan is compatible with Dataiku. Please share some code snippets if anyone has worked with pystan on Dataiku to create model instances. 

Thanks

0 Kudos
2 Replies
CatalinaS
Dataiker

Hi @amith_yadav,

 
  • Can you give more details about the issues that you are facing?
  • Are you getting any error messages?
  • Which pystan version did you install in the code env?

As mentioned in the documentation the STAN package requires very recent C++ compilers that most Linux distributions do not provide, in particular the “C++14” features. The version of pystan that you can used is related to the OS you are using. The requirement for the latest version (2.19+) of PyStan is that your OS supports C++14. 

An example code that shows how to use PyStan 3 is here.  

amith_yadav
Level 1
Author

Thanks for the response @CatalinaS. But the example code link to use PyStan 3 which you have shared is not opening up. 

We were getting the below error with PyStan 3. I have attached the screenshot as well. This is working fine with PyStan 2 but we have to get this done with PyStan 3 as well. Please let us know what could be the issue and how to resolve the error.

Building: 28.2s, done.Messages from stanc:
Warning:
  The parameter mu has no priors.
Warning:
  The parameter tau has no priors.
Error handling request
Traceback (most recent call last):
  File "/data/dataiku/dss_data/code-envs/python/personal_aammi_py37/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/data/dataiku/dss_data/code-envs/python/personal_aammi_py37/lib/python3.7/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/data/dataiku/dss_data/code-envs/python/personal_aammi_py37/lib/python3.7/site-packages/httpstan/views.py", line 253, in handle_show_params
    services_module = httpstan.models.import_services_extension_module(model_name)
  File "/data/dataiku/dss_data/code-envs/python/personal_aammi_py37/lib/python3.7/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 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /home/dssuser_aammi/.cache/httpstan/4.4.2/models/gqxgg3k4/stan_services_model_gqxgg3k4.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev

 

0 Kudos

Labels

?
Labels (1)
A banner prompting to get Dataiku