USEPA / ElectricityLCI

Creative Commons Zero v1.0 Universal
24 stars 10 forks source link

ResolutionImpossible Error: lciafmt and electricitylci depend on different versions of fedelemflowlist #184

Open dt-woods opened 2 years ago

dt-woods commented 2 years ago

FYI: the latest versions of lciafmt (v1.0.3) and electricitylci (v.1.0.1) have a conflicting (and impossible to resolve using setup.py and requirements.txt) dependencies on fedelemflowlist. This is likely caused by severe numbering in the requirements of these individual packages. Typically bug fixes (i.e., patch numbers from Backus-Naur Form Grammar as recommended by GitHub) don't cause backwards compatibility issues and, as such, probably need not be explicitly defined as a requirement; after all, it shouldn't break API functionality. Unfortunately, this breaks software installations that depend on these packages and the only solution (that I know of) is to manually install these packages one at a time allowing old dependencies to be uninstalled and new dependencies to be installed. It is my recommendation that ranges be used or specific patch fixes be removed from software release requirements in future releases.

To reproduce the error, create a new Python virtual environment and create a requirements.txt file with:

git+https://github.com/USEPA/LCIAformatter.git#egg=lciafmt
git+https://github.com/USEPA/ElectricityLCI#egg=electricitylci

The following error is encountered (using Python 3.9.10).

INFO: pip is looking at multiple versions of lciafmt to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements.txt (line 1) and -r requirements.txt (line 2) because these package versions have conflicting dependencies.

The conflict is caused by:
    lciafmt 1.0.3 depends on fedelemflowlist 1.0.8 (from git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List#egg=fedelemflowlist)
    electricitylci 1.0.1 depends on fedelemflowlist 1.0.2 (from git+https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List@v1.0.2#egg=fedelemflowlist)

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
bl-young commented 2 years ago

I think we have found that pip has trouble handling github based dependencies for a specific version so we (typically) no longer specify versions for other packages within the tool ecosystem. I believe this needs to be updated within elci setup

dt-woods commented 1 year ago

I found another resolution issue with StEwI 0.9.5 (requires numpy 1.19.3) and esupy 0.2.0 (requires numpy >1.20), which causes havoc with pandas, which doesn't work seamlessly with these variants.

WesIngwersen commented 1 year ago

@dt-woods please update to use StEWI v1.05 - that will align them https://github.com/USEPA/standardizedinventories/releases/tag/v1.0.5

FYI @bl-young