pydata / patsy

Describing statistical models in Python using symbolic formulas
Other
955 stars 104 forks source link

TypeError: '>' not supported between instances of 'NoneType' and 'sys.version_info' #191

Closed karrmagadgeteer2 closed 1 year ago

karrmagadgeteer2 commented 1 year ago

A bit of a newbie so I am not sure if this is appropriate here or for the statsmodels package. The below error shows on Python 3.11 but not Python 3.10. The test suite is run with Github workflows on ubuntu-latest, windows-latest and macos-latest with the same outcome.

/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openseries/frame.py:26: in <module>
    from statsmodels.api import OLS
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/statsmodels/api.py:72: in <module>
    from . import datasets, distributions, iolib, regression, robust, tools
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/statsmodels/distributions/__init__.py:4: in <module>
    from .discrete import genpoisson_p, zipoisson, zigenpoisson, zinegbin
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/statsmodels/distributions/discrete.py:6: in <module>
    from statsmodels.base.model import GenericLikelihoodModel
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/statsmodels/base/model.py:12: in <module>
    from statsmodels.formula import handle_formula_data
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/statsmodels/formula/__init__.py:2: in <module>
    from .formulatools import handle_formula_data
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/statsmodels/formula/formulatools.py:2: in <module>
    from patsy import dmatrices, NAAction
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/patsy/__init__.py:77: in <module>
    import patsy.highlevel
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/patsy/highlevel.py:19: in <module>
    from patsy.design_info import DesignMatrix, DesignInfo
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/patsy/design_info.py:38: in <module>
    from patsy.desc import ModelDesc, Term
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/patsy/desc.py:14: in <module>
    from patsy.eval import EvalEnvironment, EvalFactor
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/patsy/eval.py:36: in <module>
    _ALL_FUTURE_FLAGS = _all_future_flags()
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/patsy/eval.py:32: in _all_future_flags
    if feature.getMandatoryRelease() > sys.version_info:
E   TypeError: '>' not supported between instances of 'NoneType' and 'sys.version_info'
matthewwardrop commented 1 year ago

Hi @karrmagadgeteer2 ! This has already been patched in version 0.5.3. Please let me know if things don't work for you after updating; but until then I'll close this one out.

Thanks for taking the time to make our software better!

jwhendy commented 11 months ago

Should this be fixed @matthewwardrop ? I was just running some old code on a new computer, found I didn't have plydata installed, did a fresh pip install plydata, but still get this error.


% pip install plydata
Collecting plydata
  Downloading plydata-0.4.3-py3-none-any.whl (299 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 299.5/299.5 kB 2.6 MB/s eta 0:00:00
Requirement already satisfied: pandas>=1.1.5 in /opt/homebrew/lib/python3.11/site-packages (from plydata) (2.0.0)
Requirement already satisfied: python-dateutil>=2.8.2 in /opt/homebrew/lib/python3.11/site-packages (from pandas>=1.1.5->plydata) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /opt/homebrew/lib/python3.11/site-packages (from pandas>=1.1.5->plydata) (2023.3)
Requirement already satisfied: tzdata>=2022.1 in /opt/homebrew/lib/python3.11/site-packages (from pandas>=1.1.5->plydata) (2023.3)
Requirement already satisfied: numpy>=1.21.0 in /opt/homebrew/lib/python3.11/site-packages (from pandas>=1.1.5->plydata) (1.24.2)
Requirement already satisfied: six>=1.5 in /opt/homebrew/lib/python3.11/site-packages (from python-dateutil>=2.8.2->pandas>=1.1.5->plydata) (1.16.0)
Installing collected packages: plydata
Successfully installed plydata-0.4.3

% python
Python 3.11.6 (main, Nov  2 2023, 04:39:43) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import plydata
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.11/site-packages/plydata/__init__.py", line 1, in <module>
    from .one_table_verbs import *  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/plydata/one_table_verbs.py", line 6, in <module>
    from .operators import DataOperator
  File "/opt/homebrew/lib/python3.11/site-packages/plydata/operators.py", line 6, in <module>
    from .eval import EvalEnvironment
  File "/opt/homebrew/lib/python3.11/site-packages/plydata/eval.py", line 22, in <module>
    _ALL_FUTURE_FLAGS = _all_future_flags()
                        ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/plydata/eval.py", line 17, in _all_future_flags
    if feature.getMandatoryRelease() > sys.version_info:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'sys.version_info'
matthewwardrop commented 5 months ago

@jwhendy Apologies for the necrobump, but this package is patsy, not plydata. Hopefully this is resolved for you!

jwhendy commented 5 months ago

@matthewwardrop that is... pretty hilarious. 🤦 Signs of a desperate data scientist on a deadline grasping at the internet for hope. Thanks for letting me know, and I'm sure I did resolve somehow or another!