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

_pickle.PicklingError in test_serialization: Can't pickle <class 'cmdstanpy.stanfit.gq.CmdStanGQ'> #776

Open
SermetPekin opened this issue Jan 25, 2025 · 1 comment

Comments

@SermetPekin
Copy link

SermetPekin commented Jan 25, 2025

I encountered a _pickle.PicklingError when running the test suite for cmdstanpy. The error occurs in the test_serialization test within test/test_generate_quantities.py. The error message indicates that Python cannot pickle the <class 'cmdstanpy.stanfit.gq.CmdStanGQ'> object because it is "not the same object" as cmdstanpy.stanfit.gq.CmdStanGQ.

This issue may be caused by module import mismatches or problems with the environment setup.

error message

FAILED test/test_generate_quantities.py::test_serialization - _pickle.PicklingError: 
Can't pickle <class 'cmdstanpy.stanfit.gq.CmdStanGQ'>: 
it's not the same object as cmdstanpy.stanfit.gq.CmdStanGQ

I use uv to build the environment,
other tests are passing.

Python 3.10.9

This is the only test that is failing.

Environment Details

Operating System:
Darwin 192.168.1.33 23.5.0 Darwin Kernel Version 23.5.0: RELEASE_ARM64_T6020 arm64

Python Version:
3.10.9

CmdStanPy Installation:
file:///Users/UserName/Documents/cmdstanpy/cmdstanpy

Installed Python Packages:
exceptiongroup==1.2.2
iniconfig==2.0.0
numpy==2.2.2
packaging==24.2
pandas==2.2.3
pluggy==1.5.0
pytest==8.3.4
python-dateutil==2.9.0.post0
pytz==2024.2
six==1.17.0
stanio==0.5.1
tomli==2.2.1
tqdm==4.67.1
tzdata==2025.1
xarray==2025.1.1
@WardBrian
Copy link
Member

This issue may be caused by module import mismatches or problems with the environment setup.

In my experience it is usually an environment issue. I think installing from a path but not editable can lead to this?

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

2 participants