conda-forge / matplotlib-feedstock

A conda-smithy repository for matplotlib.
BSD 3-Clause "New" or "Revised" License
22 stars 58 forks source link

'version_info' object has no attribute '__version__' with python 3.6 #316

Closed IanSudbery closed 2 years ago

IanSudbery commented 2 years ago

Issue:

Installing matplotlib-base with python=3.6.0:

$ conda create -n mpl-test matplotlib-base python=3.6.0 -c conda-forge

importing matplotlib gives the following error:

Python 3.6.0 | packaged by conda-forge | (default, Feb  9 2017, 14:36:55)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mb1ims/miniconda3/envs/mpl-test/lib/python3.6/site-packages/matplotlib/__init__.py", line 107, in <module>
    from . import cbook, rcsetup
  File "/home/mb1ims/miniconda3/envs/mpl-test/lib/python3.6/site-packages/matplotlib/rcsetup.py", line 28, in <module>
    from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
  File "/home/mb1ims/miniconda3/envs/mpl-test/lib/python3.6/site-packages/matplotlib/fontconfig_pattern.py", line 15, in <module>
    from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
  File "/home/mb1ims/miniconda3/envs/mpl-test/lib/python3.6/site-packages/pyparsing/__init__.py", line 130, in <module>
    __version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'

It works fine if I allow an up to date version of python.


Environment (conda list):

``` $ conda list # packages in environment at /home/mb1ims/miniconda3/envs/mpl-test: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge ca-certificates 2021.10.8 ha878542_0 conda-forge certifi 2021.5.30 py36h5fab9bb_0 conda-forge cycler 0.11.0 pyhd8ed1ab_0 conda-forge freetype 2.10.4 h0708190_1 conda-forge jbig 2.1 h7f98852_2003 conda-forge jpeg 9e h7f98852_0 conda-forge kiwisolver 1.3.1 py36h605e78d_1 conda-forge lcms2 2.12 hddcbb42_0 conda-forge lerc 3.0 h9c3ff4c_0 conda-forge libblas 3.9.0 13_linux64_openblas conda-forge libcblas 3.9.0 13_linux64_openblas conda-forge libdeflate 1.10 h7f98852_0 conda-forge libgcc-ng 11.2.0 h1d223b6_12 conda-forge libgfortran-ng 11.2.0 h69a702a_12 conda-forge libgfortran5 11.2.0 h5c6108e_12 conda-forge libgomp 11.2.0 h1d223b6_12 conda-forge liblapack 3.9.0 13_linux64_openblas conda-forge libopenblas 0.3.18 pthreads_h8fe5266_0 conda-forge libpng 1.6.37 h21135ba_2 conda-forge libstdcxx-ng 11.2.0 he4da1e4_12 conda-forge libtiff 4.3.0 h542a066_3 conda-forge libwebp-base 1.2.2 h7f98852_1 conda-forge libzlib 1.2.11 h36c2ea0_1013 conda-forge lz4-c 1.9.3 h9c3ff4c_1 conda-forge matplotlib-base 3.3.4 py36h62a2d02_0 ncurses 5.9 10 conda-forge numpy 1.19.5 py36hfc0c790_2 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openjpeg 2.4.0 hb52868f_1 conda-forge openssl 1.0.2u h516909a_0 conda-forge pillow 8.3.1 py36h2c7a002_0 pip 21.3.1 pyhd8ed1ab_0 conda-forge pyparsing 3.0.7 pyhd8ed1ab_0 conda-forge python 3.6.0 2 conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python_abi 3.6 2_cp36m conda-forge readline 6.2 0 conda-forge setuptools 58.0.4 py36h5fab9bb_2 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge sqlite 3.13.0 1 conda-forge tk 8.5.19 2 conda-forge tornado 6.1 py36h8f6f2f9_1 conda-forge wheel 0.37.1 pyhd8ed1ab_0 conda-forge xz 5.2.5 h516909a_1 conda-forge zlib 1.2.11 h36c2ea0_1013 conda-forge zstd 1.5.2 ha95c52a_0 conda-forge ```


Details about conda and system ( conda info ):

``` $ conda info active environment : mpl-test active env location : /home/XXXX/miniconda3/envs/mpl-test shell level : 3 user config file : /home/XXXX/.condarc populated config files : conda version : 4.11.0 conda-build version : not installed python version : 3.8.5.final.0 virtual packages : __linux=5.4.72=0 __glibc=2.23=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/XXXX/miniconda3 (writable) conda av data dir : /home/XXXX/miniconda3/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/XXXX/miniconda3/pkgs /home/XXXX/.conda/pkgs envs directories : /home/XXXX/miniconda3/envs /home/XXXX/.conda/envs platform : linux-64 user-agent : conda/4.11.0 requests/2.24.0 CPython/3.8.5 Linux/5.4.72-microsoft-standard-WSL2 ubuntu/16.04.4 glibc/2.23 UID:GID : 1000:1000 netrc file : None offline mode : False ```
dopplershift commented 2 years ago

If you look carefully at the traceback you posted, you can see that the offending line:

  File "/home/mb1ims/miniconda3/envs/mpl-test/lib/python3.6/site-packages/pyparsing/__init__.py", line 130, in <module>
    __version__ = __version_info__.__version__

actually comes from pyparsing, not matplotlib. I would recommend opening an issue on the pyparsing feedstock. Closing since there's nothing wrong with the matplotlib recipe.