conda-forge / pygrib-feedstock

A conda-smithy repository for pygrib.
BSD 3-Clause "New" or "Revised" License
2 stars 8 forks source link

Does not specify jpeg dependency. Breaks if older jpeg version is already installed. #11

Closed cpaulik closed 8 years ago

cpaulik commented 8 years ago
conda create -n test-pygrib python=3.5 jpeg
Fetching package metadata .......
Solving package specifications: ..........
Using Anaconda Cloud api site https://api.anaconda.org

Package plan for installation in environment /home/cpa/.pyenv/versions/miniconda-3.16.0/envs/test-pygrib:

The following NEW packages will be INSTALLED:

    jpeg:       8d-1          defaults
    openssl:    1.0.2h-1      defaults
    pip:        8.1.2-py35_0  defaults
    python:     3.5.2-0       defaults
    readline:   6.2-2         defaults
    setuptools: 25.1.6-py35_0 defaults
    sqlite:     3.13.0-0      defaults
    tk:         8.5.18-0      defaults
    wheel:      0.29.0-py35_0 defaults
    xz:         5.2.2-0       defaults
    zlib:       1.2.8-3       defaults

Proceed ([y]/n)? y

Linking packages ...
[      COMPLETE      ]|###################################################################################################################################| 100%
#
# To activate this environment, use:
# $ source activate test-pygrib
#
# To deactivate this environment, use:
# $ source deactivate
#

/IPF/cpa/R/Datapool_processed/WARP/ancillary/warp5_grid
(miniconda-3.16.0) ❯ source activate test-pygrib
pyenv-virtualenv: activate miniconda-3.16.0/envs/test-pygrib
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.

/IPF/cpa/R/Datapool_processed/WARP/ancillary/warp5_grid
(miniconda-3.16.0/envs/test-pygrib) ❯ conda install -c conda-forge pygrib
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment /home/cpa/.pyenv/versions/miniconda-3.16.0/envs/test-pygrib:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    hdf4-4.2.12                |                0         677 KB  defaults

The following NEW packages will be INSTALLED:

    curl:        7.49.1-1       conda-forge
    ecmwf_grib:  1.16.0-0       conda-forge
    hdf4:        4.2.12-0       defaults   
    hdf5:        1.8.17-2       conda-forge
    jasper:      1.900.1-1      conda-forge
    libgfortran: 3.0.0-1        defaults   
    libnetcdf:   4.4.1-0        conda-forge
    libpng:      1.6.24-0       conda-forge
    mkl:         11.3.3-0       defaults   
    numpy:       1.11.1-py35_0  defaults   
    pygrib:      2.0.1-py35_3   conda-forge
    pyproj:      1.9.5.1-py35_0 conda-forge

Proceed ([y]/n)? y

Pruning fetched packages from the cache ...
Fetching packages ...
hdf4-4.2.12-0. 100% |################################################################################################################| Time: 0:00:29  23.28 kB/s
Extracting packages ...
[      COMPLETE      ]|###################################################################################################################################| 100%
Linking packages ...
[      COMPLETE      ]|###################################################################################################################################| 100%

/IPF/cpa/R/Datapool_processed/WARP/ancillary/warp5_grid 49s
(miniconda-3.16.0/envs/test-pygrib) ❯ conda list
# packages in environment at /home/cpa/.pyenv/versions/miniconda-3.16.0/envs/test-pygrib:
#
Using Anaconda Cloud api site https://api.anaconda.org
curl                      7.49.1                        1    conda-forge
ecmwf_grib                1.16.0                        0    conda-forge
hdf5                      1.8.17                        2    conda-forge
jasper                    1.900.1                       1    conda-forge
libnetcdf                 4.4.1                         0    conda-forge
libpng                    1.6.24                        0    conda-forge
pygrib                    2.0.1                    py35_3    conda-forge
pyproj                    1.9.5.1                  py35_0    conda-forge
hdf4                      4.2.12                        0    defaults
jpeg                      8d                            1    defaults
libgfortran               3.0.0                         1    defaults
mkl                       11.3.3                        0    defaults
numpy                     1.11.1                   py35_0    defaults
openssl                   1.0.2h                        1    defaults
pip                       8.1.2                    py35_0    defaults
python                    3.5.2                         0    defaults
readline                  6.2                           2    defaults
setuptools                25.1.6                   py35_0    defaults
sqlite                    3.13.0                        0    defaults
tk                        8.5.18                        0    defaults
wheel                     0.29.0                   py35_0    defaults
xz                        5.2.2                         0    defaults
zlib                      1.2.8                         3    defaults

/IPF/cpa/R/Datapool_processed/WARP/ancillary/warp5_grid
(miniconda-3.16.0/envs/test-pygrib) ❯ python  
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygrib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libjpeg.so.9: cannot open shared object file: No such file or directory
ocefpaf commented 8 years ago

@cpaulik I am reluctant to over-specify dependency to workaround other issues but we can take a PR to fix that if nothing works.

By other issues I mean this: pygrib depends on ecmwf_gribjasperjpeg and, from all of those, only jpeg exists on defaults. Note that jasper, which brings jpeg into the equation, is properly pinned to jpeg 9*. So, IMO, conda is not respecting that pin and is installing a broken jasper there. Breaking also ecmwf_grib and pygrib.

I do know that conda had a few improvements some time ago. They added the channel preference featire to alleviate some of those issues. Can you check if you have the latest conda and add the conda-forge channel on top of defaults in your .condarc? Maybe that solves it...

Note also that if you specify pygrib at first conda will do the right thing (conda create -n test-pygrib python=3.5 pygrib).

cpaulik commented 8 years ago

I'm using conda 4.1.11 which is the latest release. Moving the conda-forge channel before the defaults channel works.

But you are right that this is a conda problem. Running conda install -c conda-forge jasper correctly updates jpeg while jpeg as a second level dependency is not updated.

ocefpaf commented 8 years ago

But you are right that this is a conda problem

The channel preference alleviates the problem but, IMO, it does not really fixes it. Conda should update jpeg or at least refuse to install pygrib in your original scenario.