pythonocc-core icon indicating copy to clipboard operation
pythonocc-core copied to clipboard

ImportError: DLL load failed: The specified module could not be found

Open nooshinpz opened this issue 3 years ago • 3 comments

Hi I'm completely new to this part . when I use "import JupyterIFCRenderer" this error arise .

ImportError Traceback (most recent call last) in ----> 1 import JupyterIFCRenderer 2 #from utils.JupyterIFCRenderer import JupyterIFCRenderer 3 viewer = JupyterIFCRenderer(m, size=(400,300))

~\ifcopenshell-notebooks-main\ifcopenshell-notebooks-main\JupyterIFCRenderer.py in 1 import os 2 import random ----> 3 from OCC.Display.WebGl.jupyter_renderer import JupyterRenderer, format_color, NORMAL, BoundingBox 4 from ipywidgets import interact, interactive, fixed, interact_manual, IntSlider, Layout, FloatSlider 5 import ipywidgets as widgets

~\Anaconda3\lib\site-packages\OCC\Display\WebGl\jupyter_renderer.py in 60 61 ---> 62 from OCC.Core.Bnd import Bnd_Box 63 from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeSphere 64 from OCC.Core.BRepBndLib import brepbndlib_Add

~\Anaconda3\lib\site-packages\OCC\Core\Bnd.py in 16 # Import the low-level C/C++ module 17 if package or "." in name: ---> 18 from . import _Bnd 19 else: 20 import _Bnd

ImportError: DLL load failed: The specified module could not be found.

pythonocc-core=7.5.1 python=3.7 platform=windows 10 anaconda

nooshinpz avatar Jun 21 '22 08:06 nooshinpz

Hi there,

I got the same issue:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 from utils.JupyterIFCRenderer import JupyterIFCRenderer
      2 viewer = JupyterIFCRenderer(m, size=(400,300))
      3 viewer

File ~\...\JupyterIFCRenderer.py:3, in <module>
      1 import os
      2 import random
----> 3 from OCC.Display.WebGl.jupyter_renderer import JupyterRenderer, format_color, NORMAL, BoundingBox
      4 from ipywidgets import interact, interactive, fixed, interact_manual, IntSlider, Layout, FloatSlider
      5 import ipywidgets as widgets

File ~\anaconda3\envs\ifc_viewer\lib\site-packages\OCC\Display\WebGl\jupyter_renderer.py:44, in <module>
     40     print(error_log)
     41     sys.exit(0)
---> 44 from OCC.Core.Bnd import Bnd_Box
     45 from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeSphere
     46 from OCC.Core.BRepBndLib import brepbndlib_Add

File ~\anaconda3\envs\ifc_viewer\lib\site-packages\OCC\Core\Bnd.py:18, in <module>
     16 # Import the low-level C/C++ module
     17 if __package__ or "." in __name__:
---> 18     from . import _Bnd
     19 else:
     20     import _Bnd

ImportError: DLL load failed while importing _Bnd: Das angegebene Modul wurde nicht gefunden.

Already checked and reinstalled Microsoft Visual C++ Redistributable, the issue is still occurring.

  • occ 7.4.1
  • Python 3.9.12
  • Win 10

Thank you in advance!

Ron-van-Doom avatar Jun 22 '22 20:06 Ron-van-Doom

I soleved this problem by adding this line before import:

os.add_dll_directory('D:/install/OCCT/win64/vc14/bin') # replace with your occ bin directory

wanghaoyang1995 avatar Oct 28 '22 15:10 wanghaoyang1995