PolicyEngine / us-marriage-incentive

Streamlit app to evaluate marriage penalties and bonuses
https://policyengine-us-marriage-incentive.streamlit.app/
0 stars 9 forks source link

ImportError: cannot import name 'PublicDataset' from 'policyengine_core.data' #96

Closed MaxGhenis closed 2 months ago

MaxGhenis commented 2 months ago

https://policyengine-us-marriage-incentive.streamlit.app/

────────────────────── Traceback (most recent call last) ───────────────────────

  /home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrun  

  ner/exec_code.py:88 in exec_func_with_error_handling                          

  /home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrun  

  ner/script_runner.py:590 in code_to_exec                                      

  /mount/src/us-marriage-incentive/app.py:3 in <module>                         

     1 import streamlit as st                                                   

     2 import pandas as pd                                                      

  ❱  3 from policyengine_us.variables.household.demographic.geographic.state_c  

     4 import table                                                             

     5 import heatmap                                                           

     6                                                                          

  /home/adminuser/venv/lib/python3.9/site-packages/policyengine_us/__init__.py  

  :10 in <module>                                                               

     7                                                                          

     8 See https://openfisca.org/doc/key-concepts/tax_and_benefit_system.html   

     9 """                                                                      

  ❱ 10 from policyengine_us.system import (                                     

    11 │   CountryTaxBenefitSystem,                                             

    12 │   Simulation,                                                          

    13 │   Microsimulation,                                                     

  /home/adminuser/venv/lib/python3.9/site-packages/policyengine_us/system.py:1  

  2 in <module>                                                                 

     9 │   Microsimulation as CoreMicrosimulation,                              

    10 │   IndividualSim as CoreIndividualSim,                                  

    11 )                                                                        

  ❱ 12 from policyengine_us.data import CPS                                     

    13 from policyengine_us.tools.taxcalc.generate_taxcalc_variable import (    

    14 │   add_taxcalc_variable_aliases,                                        

    15 )                                                                        

  /home/adminuser/venv/lib/python3.9/site-packages/policyengine_us/data/__init  

  __.py:1 in <module>                                                           

  ❱ 1 from policyengine_us.data.datasets import CPS, RawCPS, ACS, RawACS        

    2                                                                           

  /home/adminuser/venv/lib/python3.9/site-packages/policyengine_us/data/datase  

  ts/__init__.py:1 in <module>                                                  

  ❱ 1 from .cps import CPS, RawCPS                                              

    2 from .acs import ACS, RawACS                                              

    3                                                                           

    4 DATASETS = [CPS, RawCPS, ACS, RawACS]                                     

  /home/adminuser/venv/lib/python3.9/site-packages/policyengine_us/data/datase  

  ts/cps/__init__.py:1 in <module>                                              

  ❱ 1 from policyengine_us.data.datasets.cps.cps import CPS                     

    2 from policyengine_us.data.datasets.cps.raw_cps import RawCPS              

    3                                                                           

  /home/adminuser/venv/lib/python3.9/site-packages/policyengine_us/data/datase  

  ts/cps/cps.py:2 in <module>                                                   

      1 import logging                                                          

  ❱   2 from policyengine_core.data import PublicDataset                        

      3 import h5py                                                             

      4 from policyengine_us.data.datasets.cps.raw_cps import RawCPS            

      5 from policyengine_us.data.storage import policyengine_us_MICRODATA_FOL  

────────────────────────────────────────────────────────────────────────────────

ImportError: cannot import name 'PublicDataset' from 'policyengine_core.data' 

(/home/adminuser/venv/lib/python3.9/site-packages/policyengine_core/data/__init_

_.py)
MaxGhenis commented 2 months ago

This was due to Python 3.9. I deleted and redeployed on Python 3.11, which fixed this, but caused https://github.com/PolicyEngine/us-marriage-incentive/issues/98.