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

Import Error in: from pyadjoint import ipopt # noqa: F401 in examples/poisson-topology.py #140

Open
MrOpine opened this issue Mar 16, 2024 · 1 comment

Comments

@MrOpine
Copy link

MrOpine commented Mar 16, 2024

Running demo code poisson-topology.py with VS code in Ubuntu 20.04 system,
the following error occurs at from pyadjoint import ipopt # noqa: F401,

Exception has occurred: ImportError
You need to install cyipopt. It is recommended to install IPOPT with HSL support!
ModuleNotFoundError: No module named 'cyipopt'

During handling of the above exception, another exception occurred:

File "/home/***/Documents/Fenics/demo/heat_conduction_TopOpt.py", line 5, in
from pyadjoint import ipopt # noqa: F401
ImportError: You need to install cyipopt. It is recommended to install IPOPT with HSL support!

I've tried to install IPOPT and cyipopt packages from Coin-HSL and following the instructions of https://github.com/coin-or/Ipopt and https://github.com/mechmotum/cyipopt, not working yet.

BTW, I did not use conda to install the packages. No error is found running python3 -c "import cyipopt" in terminal, but the ipopt source may not be included in the path. An error occurred if I directly run /usr/local/bin/ipopt,

/usr/local/bin/ipopt: error while loading shared libraries: libipoptamplinterface.so.3: cannot open shared object file: No such file or directory

, while it is resolved if I run LD_LIBRARY_PATH=/usr/local/lib first.

Anyone know what going on?

@jorgensd
Copy link
Member

I would suggest having a look at the dolfin-adjoint docker file, as it contains the installation instructions we use in our images
https://github.com/dolfin-adjoint/dolfin-adjoint/blob/main/docker/Dockerfile#L22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants