Skip to content
Advertisement

Import error: DLL load failed in Jupyter notebook but working in .py file

I installed BreakoutDetection the module in Anaconda environment. When I tried to import the module using import breakout_detection in jupyter notebook, I get the below error

JavaScript

I could import the same module in python shell

I looked at the system paths (print sys.path) and in both python shell and jupyter notebook. They both are the same. Executable path (print sys.executable) is also the same for the both.

Can someone help me out on the steps I should take to resolve this issue? Thanks!

Advertisement

Answer

I encountered the same problem running Jupyter Notebook from PowerShell. Even though the question was asked a year back, I am answering it here to help those who encounter the same error recently. In my case, first, I activated the root environment activate base then I ran jupyter notebook and it worked just fine. Once you activate the base, you will notice that the prompt will change like this: (base) X:Usersxxxxxcurrent-directory-name>.

  • Note that the command activate base will not work on Powershell. You have to switch to command prompt running cmd or you may try the whole thing on the command prompt instead of PowerShell.

  • If the required paths
    (path:toAnaconda3;path:toAnaconda3Scripts;path:toAnaconda3Librarymingw-w64bin;path:toAnaconda3Libraryusrbin;path:toAnaconda3Librarybin) are available to your PowerShell environment, then you don’t need to activate the “base” environment.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement