o
    0Gf!                     @   sR   d dl mZ d dlZd dlmZ dddZdd Zdd
dZedkr'e  dS dS )    )reduceN)dirname__version__c                 G   s^   t |ts|g}z	tt| g| W S  ty.   |r+t| |d g|dd  R   Y S Y dS w )Nr      zCannot detect version)
isinstancelistr   getattrAttributeErrorsafe_version)moduleattrZothers r   ?lib/python3.10/site-packages/statsmodels/tools/print_version.pyr
      s   
"r
   c                  C   s  t d t d t dtjd d    z6dd l} |  \}}}}}t d|||| t dtj  t d| jdd	  t d
| jdd	  W n   Y zdd l	}d}W n t
ya   d}Y nw t d |rqt dt|  nt d t d zdd l}t dt|  W n t
y   t d Y nw zdd l}	t dt|	ddg  W n t
y   t d Y nw zdd l}
t dt|
ddg  W n t
y   t d Y nw zdd l}t dt|  W n t
y   t d Y nw zdd l}t dt|  W n t
y   t d Y nw zdd l}t dt|  W n t
y(   t d Y nw t d zdd l}t d t|  W n t
yI   t d! Y nw zdd"lm} t d#t|d  W n t
yi   t d$ Y nw zdd l}t d%t|  W n t
y   t d& Y nw t d' zdd l}t d(t|  W n t
y   t d) Y nw zdd l}t d*t|  W n t
y   t d+ Y nw zdd l}t d,t|  W n t
y   t d- Y nw zdd l}t d.t|  W n t
y   t d/ Y nw zdd l}t d0t|t|j W n t
y    t d1 Y nw zdd l}t d2t|  W n t
y=   t d3 Y nw t d4 d S )5N
INSTALLED VERSIONS------------------Python: %d.%d.%d.%s.%sr   OS: {} {} {} {}byteorder: %s
LC_ALL: %sLC_ALLNoneLANG: %sLANGTF
statsmodels
===========
zInstalled: %sNot installed-
Required Dependencies
=====================
z
cython: %scython: Not installedz	numpy: %sversionnumpy: Not installedz	scipy: %sscipy: Not installedz
pandas: %spandas: Not installedz    dateutil: %s    dateutil: not installedz	patsy: %spatsy: Not installed-
Optional Dependencies
=====================
zmatplotlib: %smatplotlib: Not installedinfoz
cvxopt: %scvxopt: Not installedzjoblib: %s joblib: Not installed"
Developer Tools
================
zIPython: %sIPython: Not installedz    jinja2: %s    jinja2: Not installedz
sphinx: %ssphinx: Not installedz    pygments: %s    pygments: Not installedpytest: {} ({})pytest: Not installedzvirtualenv: %svirtualenv: Not installed
)printsysversion_infoosunameformat	byteorderenvirongetstatsmodelsImportErrorr
   Cythonnumpyscipypandasdateutilpatsy
matplotlibcvxoptr&   joblibIPythonjinja2sphinxpygmentspytestr   __file__
virtualenv)r5   sysnamenodenamereleaser   machiner;   has_smr=   r>   r?   r@   rA   rB   mplr&   rE   rF   rG   rH   rI   rJ   rL   r   r   r   _show_versions_only   s   rS   Tc                 C   sD  | st   td td tdtjdd   z6ddl}| \}}}}}td|||| tdtj  td|j	d	d
  td|j	dd
  W n   Y zddl
}d}W n tyf   d}Y nw td |r{tdt|t|j ntd td zddl}	tdt|	t|	j W n ty   td Y nw zddl}
tdt|
ddgt|
j W n ty   td Y nw zddl}tdt|ddgt|j W n ty   td Y nw zddl}tdt|ddgdt|j W n ty   td Y nw zddl}tdt|t|j W n ty3   td Y nw zddl}tdt|t|j W n tyU   td  Y nw td! zddl}td"t|t|j td#|jd$   W n ty   td% Y nw zdd&lm} td't|dt|j W n ty   td( Y nw zddl}td)t|t|j W n ty   td* Y nw td+ zddl}td,t|t|j W n ty   td- Y nw zddl}td.t|t|j W n ty   td/ Y nw zddl}td0t|t|j W n ty5   td1 Y nw zddl}td2t|t|j W n tyW   td3 Y nw zddl}td4t|t|j W n tyy   td5 Y nw zddl}td6t|t|j W n ty   td7 Y nw td8 dS )9z
    List the versions of statsmodels and any installed dependencies

    Parameters
    ----------
    show_dirs : bool
        Flag indicating to show module locations
    r   r   r   Nr   r   r   r   r   r   r   r   TFr   zInstalled: {} ({})r   r   zcython: {} ({})r   znumpy: {} ({})r   r   zscipy: {} ({})r   zpandas: {} ({})r   r    z    dateutil: {} ({})r!   zpatsy: {} ({})r"   r#   zmatplotlib: {} ({})z    backend: %s Zbackendr$   r%   zcvxopt: {} ({})r'   zjoblib: {} ({})r(   r)   zIPython: {} ({})r*   z    jinja2: {} ({})r+   zsphinx: {} ({})r,   z    pygments: {} ({})r-   r.   r/   zvirtualenv: {} ({})r0   r1   ) rS   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r
   r   rK   r=   r>   r?   r@   rA   rB   rC   ZrcParamsrD   r&   rE   rF   rG   rH   rI   rJ   rL   )Z	show_dirsr5   rM   rN   rO   r   rP   r;   rQ   r=   r>   r?   r@   rA   rB   rR   r&   rE   rF   rG   rH   rI   rJ   rL   r   r   r   show_versions   s.  	












rT   __main__)r   )T)		functoolsr   r3   os.pathr   r
   rS   rT   __name__r   r   r   r   <module>   s   

z 
