Some people reported problems starting Python after installing the ngsolve pip-package on MacOS, and after rebooting. Updating ngsolve to the NGSolve-6.2.2202 release solves the problem.
If pip is also not working (because of this problem), you can manually delete the directory /Library/Frameworks/Python.framework/Versions/3.10/Contents ( change 3.10 to your python version).
The error message you get, when having this problem looks like this:
dyld: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.10/Python
Referenced from: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10
Reason: tried: ‘/Library/Frameworks/Python.framework/Versions/3.10/Python’ (code signature invalid (errno=1) sliceOffset=0x004B0000, codeBlobOffset=0x00483BA0, codeBlobSize=0x000135F0 for
I am having issues with installing it through pip on Ubuntu 21.10. It does not seem to install with umfpack, something that the apt version did.
Running the following line a_assembled.mat.Inverse(freedofs=freedofs, inverse="umfpack") works with the apt version, but crashes the pip installation.
Is this an oversight, a temporary limitation, or a permanent limitation of the pip install?
Additionally, this page shows the default CMake options when building from source. Is there a list to show which options are enabled for the different distribution modes (pip, apt, conda, etc.) of NGSolve?
I tried the pip installer on windows with anaconda
Running the conda environement
conda create -n test python=3.9
I gave pip install ngsolve a try. The install works, even netgen opens a gui, but ngsolve cannot find ngslib.
(EDIT: I tried without conda and got the same result.)
from .ngslib import version, ngstd, bla, la, fem, comp, solve
ImportError: DLL load failed while importing ngslib: The specified module could not be found.
I tried to add everything to PATH and PYTHONPATH by hand without success. I uploaded the output of conda info --system here
I also tried
conda install -c ngsolve ngsolve
but could not find a python version that would satisfy the specifications. I tried python3.9 giving
ngsolve → python[version=‘>=3.7,<3.8.0a0|>=3.8,<3.9.0a0’]
so I tried python3.7 telling me
I am facing the very same problems described by paul.stocker.
Which version of Anaconda should we use?
Is there a workaround to solve the problem?
Thanks a lot and best regards,
I just added these lines to the ngsolve sources, a new nightly pip build will be released later today.
Note that the conda channel ngsolve is not maintained, pip is the preferred way to install ngsolve.
Hi Sgroi & Matthias,
thank you for your reply!
For me, the import of netgen already fails, so this does not solve it in my case. My error is:
File “C:\Users\IEUser\AppData\Local\Programs\Python\Python310\lib\site-packages\netgen_init_.py”, line 18, in
from . import libngpy
ImportError: DLL load failed while importing libngpy: The specified module could not be found.
I put the site_package dir and even the netgen and ngsolve dir into my PATH and PYTHONPATH, is there any other variable I should be aware of so python can find the files?
Weirdly enough, the init of netgen can import the config file but fails on the libngpy.
I then tried to import libngpy from inside the config file and it worked… wat? (But still failing to import libngs later on…)
now I can import properly ngsolve.
I still have an issue with the first problem of the tutorial, the Poisson example. I modified the Jupyter notebook as follows:
netgen_dir = os.path.dirname(netgen.file)
os.environ[“PATH”] += os.pathsep + netgen_dir
from ngsolve import * #from netgen.geom2d import unit_square
from netgen.occ import unit_square
from ngsolve.webgui import Draw
but executing Draw (gfu, mesh) I get the following error:
TypeError Traceback (most recent call last)
Cell In , line 1 ----> 1 Draw (gfu, mesh)
TypeError: Draw(): incompatible function arguments. The following argument types are supported:
Invoked with: <ngsolve.comp.GridFunction object at 0x000001ECA9D6D860>, <ngsolve.comp.Mesh object at 0x000001ECA9C3CDB0>
So essentially I cannot plot the solution.
Thanks a lot in advance and best regards,
you have to pass a string as name for the function in the third argument. Something like
Draw (gfu, mesh, “gfu”)
Also, in case you want the drawing to show up in the notebook (and not in the netgen gui) you need to install the webgui, you can find the instructions here: https://docu.ngsolve.org/latest/i-tutorials/index.html
Can you tell me which python version and ngsolve version you are using? I still cannot import netgen.
I am attempting to install ngsolve version 6.2.2204 (for compatibility reasons with xfem) and when I do “pip3 install ngsolve==6.2.2204” I receive the following error message:ERROR: Could not find a version that satisfies the requirement ngsolve==6.2.2204 (from versions: 6.2.2204.post148.dev0, 6.2.2204.post160.dev0, 6.2.2204.post192.dev0, 6.2.2301, 6.2.2301.post259.dev0, 6.2.2302)ERROR: No matching distribution found for ngsolve==6.2.2204
Is there something going on on my end? I appreciate any help!
where can I find this PIP installer for MacOS Monterey version? I have this problem showing up when I launch Netgen. Here is what I get when I open Netgen below. what do I do to be able to open Netgen? I tried downloading Python and it didnt work. thanks /Applications/Netgen.app/Contents/MacOS/startup.sh ; exit; farahpiatek@Farahs-MacBook-Air ~ % /Applications/Netgen.app/Contents/MacOS/startup.sh ; exit;dyld: Library not loaded: ‘/Library/Frameworks/Python.framework/Versions/3.8/Python’ Referenced from: ‘/Applications/Netgen.app/Contents/MacOS/netgen’ Reason: tried: ‘/Library/Frameworks/Python.framework/Versions/3.8/Python’ (no such file), ‘/System/Library/Frameworks/Python.framework/Versions/3.8/Python’ (no such file)/Applications/Netgen.app/Contents/MacOS/startup.sh: line 10: 13301 Abort trap: 6 $Netgen_MACOS/netgen Saving session…copying shared history…saving history…truncating history files…completed.Deleting expired sessions…none found. [Process completed]