InstituteforDiseaseModeling / synthpops

Create synthetic populations for COVID-19 epidemic analyses.
https://docs.idmod.org/projects/synthpops
Other
44 stars 44 forks source link

Install in Anaconda Virtual Environment Fails Due to Missing jsonobject Distribution #73

Closed DouglasUrner closed 6 days ago

DouglasUrner commented 1 month ago

Installing in an Anaconda (conda 24.5.0) on macOS 14.6.1 with python 3.8.11 ends with the following message when running python setup.py develop:

error: The 'jsonobject' distribution was not found and is required by synthpops

The full error seems to be:

.
.
.
jsonobject/containers.c:15444:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                    CYTHON_FALLTHROUGH;
                    ^
jsonobject/containers.c:357:34: note: expanded from macro 'CYTHON_FALLTHROUGH'
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
                                 ^
jsonobject/containers.c:15455:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                    CYTHON_FALLTHROUGH;
                    ^
jsonobject/containers.c:357:34: note: expanded from macro 'CYTHON_FALLTHROUGH'
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
                                 ^
4 warnings generated.
jsonobject/properties.c:9264:5: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
    0,
    ^
/opt/anaconda3/envs/py3.8.11/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
    Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
    ^
/opt/anaconda3/envs/py3.8.11/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
1 warning generated.
jsonobject/utils.c:5526:5: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
    0,
    ^
/opt/anaconda3/envs/py3.8.11/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
    Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
    ^
/opt/anaconda3/envs/py3.8.11/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
1 warning generated.
zip_safe flag not set; analyzing archive contents...
jsonobject.__pycache__.api.cpython-38: module references __file__
jsonobject.__pycache__.base.cpython-38: module references __file__
jsonobject.__pycache__.base_properties.cpython-38: module references __file__
jsonobject.__pycache__.containers.cpython-38: module references __file__
jsonobject.__pycache__.properties.cpython-38: module references __file__
jsonobject.__pycache__.utils.cpython-38: module references __file__
No eggs found in /var/folders/kd/9xzksscs5qg0xr_gm9lcp4km0000gp/T/easy_install-g4l__f2s/jsonobject-2.2.0/egg-dist-tmp-_190pzmb (setup script problem?)
error: The 'jsonobject' distribution was not found and is required by synthpops
DouglasUrner commented 1 month ago

This is what I needed to do to get SynthPops to run the Quick Start example:

# Close the repository:
git clone https://github.com/InstituteforDiseaseModeling/synthpops.git

# Add the missing components:
pip install jsonobject cmasher cmocean graphviz pydot sciris

# Run the configuration script:
python setup.py develop

I did this in an Anaconda (24.5.0) virtual environment using python 3.8.11 on macOS (14.6.1).

DouglasUrner commented 1 month ago

In addition, the jsonobjects install needs development tools (C++ compiler). Lots of folks will have that installed, but probably worth noting as a prerequisite.

daniel-klein commented 6 days ago

Thanks for the issue and associated PR, closing this issue now.