Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 5 import error when running pymc model #201

Open
EAly opened this issue Jul 18, 2022 · 9 comments
Open

Chapter 5 import error when running pymc model #201

EAly opened this issue Jul 18, 2022 · 9 comments

Comments

@EAly
Copy link

EAly commented Jul 18, 2022

I get the following error when I try to run any pymc model from chapter 5, e.g. Code 5.3, Code 5.6, Code 5.10:

ImportError                               Traceback (most recent call last)
File ~/miniconda3/envs/StatsReth_Py39/lib/python3.9/site-packages/aesara/link/c/lazylinker_c.py:79, in <module>
     78         if version != actual_version:
---> 79             raise ImportError(
     80                 "Version check of the existing lazylinker compiled file."
     81                 f" Looking for version {version}, but found {actual_version}. "
     82                 f"Extra debug information: force_compile={force_compile}, _need_reload={_need_reload}"
     83             )
     84 except ImportError:

ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.212, but found 0.211. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
File ~/miniconda3/envs/StatsReth_Py39/lib/python3.9/site-packages/aesara/link/c/lazylinker_c.py:100, in <module>
     99     if version != actual_version:
--> 100         raise ImportError(
    101             "Version check of the existing lazylinker compiled file."
    102             f" Looking for version {version}, but found {actual_version}. "
    103             f"Extra debug information: force_compile={force_compile}, _need_reload={_need_reload}"
    104         )
    105 except ImportError:
    106     # It is useless to try to compile if there isn't any
...
    329     del sys.path[0]
--> 331 assert fullpath.startswith(rval.__file__)
    332 return rval

AssertionError: 

I exported the details of the environment I'm using to the attached txt files (I'm sorry if this is not the optimal way to share environments, but this is the best of my knowledge)
stats_reth2_ea_env.txt

stats_reth2_ea_envExport.txt

@canyon289
Copy link
Member

Have you tried using this environment with the package versions listed here?
https://github.com/pymc-devs/pymc-resources/blob/main/Rethinking_2/environment.yml

@EAly
Copy link
Author

EAly commented Jul 18, 2022

The environment I'm using is pretty much the same, except that I'm using pymc v4

@canyon289
Copy link
Member

That explains it. PyMC V4 has multiple breaking changes and isnt compatible with the notebooks in that directory. Id suggest using that version exactly, or if youd like upgrading the rethinking notebooks to v4 in prs.

@EAly
Copy link
Author

EAly commented Jul 18, 2022

Just to be sure, are you referring to this pull request: #198?

@canyon289
Copy link
Member

canyon289 commented Jul 18, 2022 via email

@EAly
Copy link
Author

EAly commented Jul 19, 2022

Actually the use of aesara instead of theano, as per the notebook, solved the problem and the models are working fine so far (up to code snippet 5.10). I'm not sure though if others changes need to be done to the other packages in the environment.

@canyon289
Copy link
Member

canyon289 commented Oct 11, 2022 via email

@symeneses
Copy link

I read in the Rethinking README that chapters 14, 15 and 16 are left to be migrated. Is someone working on that? I didn't find any related issue.

@yahrMason
Copy link
Contributor

@symeneses chapter 14 updates are on main, you can find the 15 and 16 updates on this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants