Import Error when called from other than the NGSolve GUI

More
4 years 4 months ago #2787 by ankita
I am facing the same problem as jleman (ImportError: DLL load failed: The specified procedure could not be found.) and its the first time that I have downloaded ngsolve after reading instructions. Also, I have already downgraded my ipykernel to version 4.10.0. Now, what else should I do? Please reply asap
More
4 years 4 months ago #2788 by dong
I had the same problem before. I uninstalled everything, then installed the newest version of ngsolve. It worked.
More
4 years 2 months ago #2999 by 8bit-Dude
I made a fresh install of Miniconda3 py37 4.8.3, and installed with "conda install -c ngsolve ngsolve"

For some reason, this installed version 6.2.2004 (instead of 2007, which was just released today).

I cannot run any of the NGSolve examples in either Spyder or command line Python. I always get the error:

from ngsolve import *

File "C:\Miniconda3\lib\site-packages\ngsolve\__init__.py", line 13, in <module>
from .ngslib import __version__, ngstd, bla, la, fem, comp, solve

ImportError: DLL load failed: The specified procedure could not be found.
More
4 years 2 months ago #3000 by matthiash
There seem to be issues with dependency solving in conda recently, see
github.com/conda/conda/issues/9367

Make sure that netgen ist installed from channel ngsolve and not from conda-forge.
You can try either
conda update --all
or
conda remove netgen ngsolve
conda install -c ngsolve netgen
conda install -c ngsolve ngsolve

Another possibility is to use the ngsolve-nighlty package (due to another name it will not consider netgen in conda-forge as dependency).

Best,
Matthias
More
4 years 2 months ago #3009 by 8bit-Dude
Thanks for the suggestion Matthiash, it worked for me!
Please note that NetGen got downgraded when I installed NGSolve:

C:\Miniconda3>conda install -c ngsolve netgen
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

environment location: C:\Miniconda3

added / updated specs:
- netgen


The following packages will be downloaded:

package | build
|
ffmpeg-3.4.2 | hf82bc7d_1 17.2 MB conda-forge
netgen-6.2.2005 | py37_5 4.2 MB ngsolve
Total: 21.5 MB

The following NEW packages will be INSTALLED:

ffmpeg conda-forge/win-64::ffmpeg-3.4.2-hf82bc7d_1
netgen ngsolve/win-64::netgen-6.2.2005-py37_5


Proceed ([y]/n)? y


Downloading and Extracting Packages
ffmpeg-3.4.2 | 17.2 MB | ############################################################################ | 100%
netgen-6.2.2005 | 4.2 MB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

C:\Miniconda3>conda install -c ngsolve ngsolve
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

environment location: C:\Miniconda3

added / updated specs:
- ngsolve


The following packages will be downloaded:

package | build
|
netgen-6.2.2004 | py37_25 4.2 MB ngsolve
Total: 4.2 MB

The following NEW packages will be INSTALLED:

ngsolve ngsolve/win-64::ngsolve-6.2.2004-py37_6

The following packages will be DOWNGRADED:

netgen 6.2.2005-py37_5 --> 6.2.2004-py37_25


Proceed ([y]/n)? y


Downloading and Extracting Packages
netgen-6.2.2004 | 4.2 MB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
More
2 years 8 months ago - 2 years 8 months ago #4133 by evanmirk
To make it short, it means that you lacked some "dependencies" for the libraries you wanted to use. This is a common problem when installing python packages, mainly in windows. Before trying to use any kind of library, first it is suggested to look up whether it needs another library in python "family".

The solution is to provide the python interpreter with the path-to-your-module/library. The simplest solution is to append that python path to your sys.path list. In your notebook, first try:

import sys
sys.path.append('my/path/to/module/folder')

This isn't a permanent change in sys.path, because when you log out, your environment is reset, so any variables you may have set are lost.

The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules.

from BASH type: export PYTHONPATH=/path/to/new/folder:/another/path/...../ #each path must be separated by a colon
Last edit: 2 years 8 months ago by evanmirk.
Time to create page: 0.115 seconds