Infant
Infant

Reputation: 1

ModuleNotFound error after sucessfully install cgal using conda?

I installed CGAL in windows using conda: https://anaconda.org/conda-forge/cgal But it gives error during importing modules.

>>> import CGAL
>>> print(CGAL.__version__)
4.14.0
>>> import CGAL.CGAL_AABB_tree
Traceback (most recent call last):
  File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 17, in <module>
    _CGAL_AABB_tree = swig_import_helper()
  File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py", line 16, in swig_import_helper
    return importlib.import_module('_CGAL_AABB_tree')
  File "C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_CGAL_AABB_tree'

Upvotes: 0

Views: 499

Answers (1)

FlyingTeller
FlyingTeller

Reputation: 20570

The issue is not the ModuleNotFoundError, but the underlying ImportError: DLL load failed:. Looking at your error message, you can see that your python does succesfully locate what you are trying to import at

C:\Users\Ibrahim Khalilullah\.conda\envs\CGALCONDA\lib\site-packages\CGAL\CGAL_AABB_tree.py

but fails to load a dependent DLL.

I have reproduced your issue. It seems to be one that only effects the most current of cgal in conda forge, which is 4.14 When you install the 4.13 version everything works fine, so simply do:

conda remove cgal
conda install -c conda-forge cgal==4.13

I have created an issue on the conda-forge feedstock

Upvotes: 1

Related Questions