CGAL / cgal-swig-bindings

CGAL bindings using SWIG
Other
341 stars 93 forks source link

Module not found for python bindings #165

Open jspanchu opened 4 years ago

jspanchu commented 4 years ago
$ python --version
Python 3.6.4
$ swig -version

SWIG Version 3.0.12
Compiled with icpc [x86_64-pc-linux-gnu]
Configured options: +pcre
$ python
Python 3.6.4 (default, Dec 12 2019, 22:32:08) 
[GCC Intel(R) C++ gcc 6.4 mode] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from CGAL.CGAL_Kernel import Point_3
Traceback (most recent call last):
  File "/opt/Python/3.6.4-intel-2018a/lib/python3.6/site-packages/CGAL/CGAL_Kernel.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/opt/Python/3.6.4-intel-2018a/lib/python3.6/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 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'CGAL._CGAL_Kernel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/Python/3.6.4-intel-2018a/lib/python3.6/site-packages/CGAL/CGAL_Kernel.py", line 17, in <module>
    _CGAL_Kernel = swig_import_helper()
  File "/opt/Python/3.6.4-intel-2018a/lib/python3.6/site-packages/CGAL/CGAL_Kernel.py", line 16, in swig_import_helper
    return importlib.import_module('_CGAL_Kernel')
  File "/opt/Python/3.6.4-intel-2018a/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_CGAL_Kernel'
sloriot commented 4 years ago

what is lib dir? To begin with, you can try to run python from the generated build-python directory after doing make.

jspanchu commented 4 years ago

By lib dir, I meant I tried to append /opt/Python/3.6.4-intel-2018a/lib/python3.6/site-packages/ to $PYTHONPATH, but that doesn't matter since it was already present in $PYTHONPATH.

It works from build-python directory but fails with ModuleNotFoundError from the install directory.