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

pylogit fails with python 3.10 #88

Open
ChristianZimpelmann opened this issue Feb 22, 2023 · 2 comments
Open

pylogit fails with python 3.10 #88

ChristianZimpelmann opened this issue Feb 22, 2023 · 2 comments

Comments

@ChristianZimpelmann
Copy link

File C:\.conda\envs\gettsim-application\lib\site-packages\pylogit\__init__.py:10
      2 """
      3 Created on Mon Mar 14 15:33:07 2016
      4 
      5 @author: timothyb0912
      6 @module: pylogit
      7 """
      8 from __future__ import absolute_import
---> 10 from .pylogit import create_choice_model
     11 from .bootstrap import Boot
     12 from .choice_tools import convert_wide_to_long

File C:\.conda\envs\gettsim-application\lib\site-packages\pylogit\pylogit.py:25
      2 """
      3 Created on Mon Feb 29 22:07:30 2016
      4 
   (...)
     21              mixed_logit.py]
     22 """
     23 from __future__ import absolute_import
---> 25 from . import conditional_logit as mnl
     26 from . import asym_logit
     27 from . import uneven_logit

File C:\.conda\envs\gettsim-application\lib\site-packages\pylogit\conditional_logit.py:20
     17 from scipy.sparse import diags
     19 from . import choice_calcs as cc
---> 20 from . import base_multinomial_cm_v2 as base_mcm
     21 from .estimation import LogitTypeEstimator
     22 from .estimation import estimate

File C:\.conda\envs\gettsim-application\lib\site-packages\pylogit\base_multinomial_cm_v2.py:27
     24 import numpy as np
     25 import pandas as pd
---> 27 from .choice_tools import create_design_matrix
     28 from .choice_tools import create_long_form_mappings
     29 from .choice_tools import convert_mixing_names_to_positions

File C:\.conda\envs\gettsim-application\lib\site-packages\pylogit\choice_tools.py:15
     13 import warnings
     14 from collections import OrderedDict
---> 15 from collections import Iterable
     16 from numbers import Number
     18 import numpy as np

ImportError: cannot import name 'Iterable' from 'collections' (C:\.conda\envs\gettsim-application\lib\collections\__init__.py)

@AlvinToh2018
Copy link

Looks like https://github.com/aviyashchin/pylogit has updated it in the meantime? Many thanks!

@leeek
Copy link

leeek commented Jul 12, 2023

As a workaround, you can also run import collections.abc; collections.Iterable = collections.abc.Iterable before importing pylogit.

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

3 participants