Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to install Ipopt on Mac #968

Closed
2 tasks done
nikhil550 opened this issue Feb 7, 2024 · 10 comments
Closed
2 tasks done

unable to install Ipopt on Mac #968

nikhil550 opened this issue Feb 7, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@nikhil550
Copy link

nikhil550 commented Feb 7, 2024

Checklist

  • I am using the current main branch or the latest release. Please indicate.
  • I am running on an up-to-date pypsa-earth environment. Update via conda env update -f envs/environment.yaml.

Describe the Bug

Installing pypsa earth on Mac M1, mamba was unable to install Ipopt dependecy.

Error Message

mamba env create -f envs/environment.yaml yielded the following error:

Could not solve for environment specs
The following package could not be installed
└─ ipopt <3.13.3  does not exist (perhaps a typo or a missing channel).

with conda env update:

PackagesNotFoundError: The following packages are not available from current channels:

  - ipopt[version='<3.13.3']
@nikhil550 nikhil550 added the bug Something isn't working label Feb 7, 2024
@davide-f
Copy link
Member

davide-f commented Feb 8, 2024

Hello @nikhil550 !
Thanks for notifying.
That is weird as generally CI passes, it may be really OS-specific.
You may try to drop the dependency in the env/environment file, just to create the environment.
Then you may install ipopt in mac using an alternative approach. That should work.

It is worth keeping this issue open so that we track the problem and later revise the environment as the #494 issue is solved, which enables to upgrade pypsa and support the solving capabilities using linopy.

@GbotemiB
Copy link
Contributor

I faced the same issue. Removing the constraint on ipopt in the environment.yml file should solve the issue.

@nikhil550
Copy link
Author

I was able to install by removing removing Ipopt and installing locally per the recommendation above.

@mfripp
Copy link

mfripp commented Apr 12, 2024

This occurs because envs/environment.yaml requires ipopt <3.13.3 but the first version available for Apple silicon (arm/M1 or later) is 3.14.5. You can see this by running the following commands:

# search for macOS arm architecture
CONDA_SUBDIR=osx-arm64 conda search ipopt

# search for macOS x86 architecture
CONDA_SUBDIR=osx-64 conda search ipopt

It is possible to work around this by running CONDA_SUBDIR=osx-64 mamba env create -f envs/environment.yaml, which will create an x86 environment. But pypsa-earth will then in emulation mode, which reduces performance. Or users can change the ipopt version dependency in envs/environment.yaml, with unknown side effects.

Would it be possible to update pypsa-earth to work with ipopt 3.14.5 or later?

@ekatef
Copy link
Member

ekatef commented Apr 15, 2024

Thanks for sharing your experience @mfripp!

As discussed above, that is a system-dependent issue a clean solution for which requires introducing consecutive fixes into the environment. For the newer Mac OS versions, removing the version constraint for ipopt is known to work fine (although, for other OS the constraint may be still needed).

@finozzifa
Copy link
Contributor

finozzifa commented Jul 4, 2024

Hi all,

Current situation
In the environment.yaml file we enforce ipopt<3.13.3. This works fine for CI-windows and CI-linux. However it does not work for CI-mac, because there are no available versions of ipopt<3.13.3 on Mac.

Experiment

I tried to remove ipopt<3.13.3. In this case, CI-linux and CI-Mac work fine, however CI-windows fails with the following error
WARNING:__main__:The configured solverglpkdoes not support quadratic objectives. Falling back toipopt. WARNING:pyomo.solvers:Could not locate the 'ipopt' executable, which is required for solver ipopt ERROR:_helpers:An error happened in module 'C:\\Users\\runneradmin\\miniconda3\\envs\\pypsa-earth\\lib\\site-packages\\pyomo\\opt\\solver\\shellcmd.py', function 'available': No executable found for solver 'ipopt'.

After a bit of reading I found an explanation at this link.

@davide-f
Copy link
Member

CI is passing with Mac and linopy is now integrated with environment update.
#1172 #1276
Can we close this? :)

@nikhil550
Copy link
Author

@davide-f Since I opened I will be a good citizen and retest and close.

@davide-f
Copy link
Member

Much appreciated, if you don't have availability, please advise.

@nikhil550
Copy link
Author

Tested and works as documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants