msmasnadi / OPGEEv4

OPGEE v4
Other
10 stars 4 forks source link

horner import error in newest version #2

Open atecza-rmi opened 1 year ago

atecza-rmi commented 1 year ago

@rjplevin After pulling the latest version and running the opg run -a example command I am receiving an ImportError: cannot import name 'horner' from 'chemicals.utils'. Other team members have also tried and are receiving the same error.

rjplevin commented 1 year ago

I've never seen that specific error before. It suggests that "chemicals" added a dependency that's not in its "requirements" file.

How are you building OPGEE? Perhaps we should schedule a call / screen share.

atecza-rmi commented 1 year ago

@rjplevin Thank you so much for the prompt reply, it also seemed odd to me. I am building the environment using the install instructions from the documentation (.yml file for mac). I will send a meeting invite via email to resolve.

bcspragu commented 1 year ago

I ran into a similar issue, with a Dockerized version of OPGEE

ImportError: cannot import name 'log' from 'chemicals.utils' (/opt/conda/envs/opgee/lib/python3.9/site-packages/chemicals/utils.py)

Here's the Dockerfile:

FROM continuumio/miniconda3

# Latest commit as of 2023-01-27, worked in January, broken now
ARG OPGEE_COMMIT=07fdca83cbbcc9f0aa22bb6dc8d50ce1e02559e5

# Newest, also broken
# ARG OPGEE_COMMIT=9f55eab4733ee9d92eac883c482aa7b4086081a5

WORKDIR /usr/src/app

RUN git clone https://github.com/Stanford-EAO/OPGEEv4.git --branch master --single-branch . \
  && git checkout $OPGEE_COMMIT
RUN conda env create -f py3-opgee-linux.yml
RUN conda init bash
RUN bash -c "source /root/.bashrc && conda activate opgee && pip install --editable . && opg config"

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

Where entrypoint.sh is a simple wrapper:

#!/bin/bash
source /root/.bashrc
conda activate opgee

exec "$@"

It's worth noting that when I originally built the image in January, I was able to successfully run simulations, but now neither build, the January commit or the most recent commit, are successful when I build them fresh, leading me to believe that some dependency isn't actually being pinned and is pulling in some recent, broken version. I don't know which dep is the problem though, because it does appear that thermo is pinned to a version:

https://github.com/Stanford-EAO/OPGEEv4/blob/9f55eab4733ee9d92eac883c482aa7b4086081a5/py3-opgee-linux.yml#L38

All this with the caveat that I'm not good at Python dependency shenanigans.

bcspragu commented 1 year ago

Oh wait, looks like the issue is indeed related to thermo, see https://github.com/CalebBell/thermo/issues/135