cmutel / conda-recipes

0 stars 2 forks source link

conda install brightway2 not working due to versioning chaos #2

Closed haasad closed 6 years ago

haasad commented 6 years ago

At the moment, the conda install brightway2 installation is broken, due to the following error:

In [1]: import brightway2 as bw
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-a3ddbb8a34e8> in <module>()
----> 1 import brightway2 as bw

~/miniconda3/envs/aab_bw/lib/python3.6/site-packages/brightway2/__init__.py in <module>()
      2 from bw2data import *
      3 from bw2calc import *
----> 4 from bw2io import *
      5 
      6 __version__ = (2, 1, 1)

~/miniconda3/envs/aab_bw/lib/python3.6/site-packages/bw2io/__init__.py in <module>()
     56 )
     57 from .migrations import migrations, Migration, create_core_migrations
---> 58 from .importers import (
     59     CSVImporter,
     60     Ecospold1LCIAImporter,

~/miniconda3/envs/aab_bw/lib/python3.6/site-packages/bw2io/importers/__init__.py in <module>()
     14 from .ecospold2_biosphere import Ecospold2BiosphereImporter
     15 from .excel import ExcelImporter
---> 16 from .simapro_csv import SimaProCSVImporter
     17 from .simapro_lcia_csv import SimaProLCIACSVImporter

~/miniconda3/envs/aab_bw/lib/python3.6/site-packages/bw2io/importers/simapro_csv.py in <module>()
     26 from ..utils import default_delimiter
     27 from .base_lci import LCIImporter
---> 28 from bw2data import databases, Database, config, database_parameters
     29 from time import time
     30 import copy

ImportError: cannot import name 'database_parameters'

This is caused by an outdated version of bw2io (0.5.11 instead of 0.6.RC3). For some reason the most recent conda pulls 0.5.11 instead of 0.6.RC3. I noticed this error thanks to the CI of the activity-browser (see here). All OSs are affected, I manually verified it on win and linux.

Steps to reproduce the issue:

conda update conda
conda create -n issue1 python=3.6 ipython
source activate issue1
conda install brightway2 # assuming channels are set in .condarc
ipython
import brightway2 as bw

I think it's likely that there was a change in the way conda parses the version strings and somehow doesn't like the RC3 suffix, but I think you know more than me about semantic versioning etc. Any idea what might cause this?

haasad commented 6 years ago

Maybe it's enough to get rid of the version constraint here.

haasad commented 6 years ago

Looking at the CI history of the activity-browser, it looks like the version bump of bw2data from 3.0 to 3.1 is when this started happening. And when you look at the download statistics, it appears that 3.0.rc1 took precedence over 3.0 and 3.0.rc2, because there should have been a lot of downloads from travis during that time.

The .rc suffix seems to cause issues for conda

haasad commented 6 years ago

I think the offending line is here: https://github.com/cmutel/conda-recipes/blob/0b8705e4302d742fe482567b5e9de83fa0f1c417/bw2io/meta.yaml#L39

bw2io pins bw2data to 3.0.rc1 which makes bw2io 0.6.RC3 and bw2data 3.1 incompatible. Conda then installs the most recent version of bw2io without this constraint -> 0.5.11

haasad commented 6 years ago

fixed