IDAES / idaes-pse

The IDAES Process Systems Engineering Framework
https://idaes-pse.readthedocs.io/
Other
218 stars 235 forks source link

Issues with developer installation with "Failed to build jupyter_contrib_nbextensions" error #1529

Closed andrewlee94 closed 3 days ago

andrewlee94 commented 1 week ago

(Note from @lbianchi-lbl: I've amended the title following confirmation that the error described in https://github.com/IDAES/idaes-pse/issues/1529#issuecomment-2468996187 also applies to @andrewlee94's original reporting of the issue)

I did a new developer installation of IDAES today on Windows and found a few things that were missing from the installation instructions:

  1. Instructions appear to skip the step of actually installing IDAES. They go from setting up and activating the conda environment to pip install -r requirements-dev.txt which only installs the developer dependencies. When you then try to run idaes get-extension you get an error as IDAES has not been installed yet.
  2. pip install -r requirements-dev.txt installed a new version of Pyomo even though I had a fresh clone of Pyomo already installed. There is a note about this, but it comes after the instruction to run this command.
  3. Pytest was not installed on my machine by default for some reason, so I had to install it separately through conda (after receiving an error when trying to run it the first time).
lbianchi-lbl commented 1 week ago

@andrewlee94 did this happen using a Conda environment? While it's possible to install IDAES without Conda, it's definitely an uphill battle, especially on Windows.

andrewlee94 commented 1 week ago

It was not in a conda environment, although I did install Miniconda first.

dallan-keylogic commented 1 week ago

Recall that you should be using Miniforge now. Also, the Pyomo thing is a known issue, and the last time we discussed it the easiest way was just to install from requirements-dev then uninstall that version of Pyomo and reinstall from sources.

As for idaes get-extensions, I haven't had any issues with the developer installation instructions. I can just install from requirements-dev.txt then run it.

lbianchi-lbl commented 1 week ago

Building on what @dallan-keylogic said, I'm fairly confident that (1) and (3) from @andrewlee94's original list can be traced back to environment issues (such as e.g. a mismatch between the python executable and the pip executable causing the dependencies to be installed in a location that the current Python runtime is unable to access) that should not apply with a Conda-based workflow.

dallan-keylogic commented 1 week ago

Actually, I just tried running through things in Windows Sandbox and had issues, so @andrewlee94 is probably on to something (as was likely from the beginning).

pip install requirements-dev.txt failed with the error

Failed to build jupyter_contrib_nbextensions
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (jupyter_contrib_nbextensions)

and I was unable to run idaes get-extensions.

lbianchi-lbl commented 1 week ago

Actually, I just tried running through things in Windows Sandbox and had issues, so @andrewlee94 is probably on to something (as was likely from the beginning).

pip install requirements-dev.txt failed with the error

Failed to build jupyter_contrib_nbextensions
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (jupyter_contrib_nbextensions)

and I was unable to run idaes get-extensions.

@andrewlee94: @dallan-keylogic and I are trying to debug this issue, but I haven't been able to reproduce it yet on the Windows machine I'm using for testing. Can you check if the same error message was shown when you ran the pip install -r requirements-dev.txt?

andrewlee94 commented 1 week ago

@lbianchi-lbl I did get the same error as Doug but mostly ignored and forgot it as I figured I didn't care too much about notebooks. I did not stop to think it might have been a terminal error that stopped the installation before it finished/

lbianchi-lbl commented 1 week ago

OK, thanks for confirming, it looks like is a genuine issue and I was wrong for summarily chucking it into the "Windows is weird, just use Conda" bin, sorry about that.

If you don't mind, I'll edit the title so that it's more descriptive now that we have a better sense of what's happening.

dallan-keylogic commented 1 week ago

@andrewlee94 If you comment out jupyter_contrib_nbextensions in requirements-dev.txt, the installation works fine. It's unclear why that suddenly broke at the moment.