Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import numba inside ipykernel: OSError: Could not load shared object file: llvmlite.dll #6959

Closed
2 tasks done
scratchmex opened this issue Apr 21, 2021 · 8 comments
Closed
2 tasks done
Labels
more info needed This issue needs more information stale Marker label for stale issues.

Comments

@scratchmex
Copy link

Reporting a bug

If you run import numba inside a Jupyter notebook it throws:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-b9db46d3506b> in <module>
----> 1 import numba
      2 print(numba.__version__)

~\miniconda3\lib\site-packages\numba\__init__.py in <module>
     17 
     18 
---> 19 from numba.core import config
     20 from numba.testing import _runtests as runtests
     21 from numba.core import types, errors

~\miniconda3\lib\site-packages\numba\core\config.py in <module>
     14 
     15 
---> 16 import llvmlite.binding as ll
     17 
     18 IS_WIN32 = sys.platform.startswith('win32')

~\miniconda3\lib\site-packages\llvmlite\binding\__init__.py in <module>
      2 Things that rely on the LLVM library
      3 """
----> 4 from .dylib import *
      5 from .executionengine import *
      6 from .initfini import *

~\miniconda3\lib\site-packages\llvmlite\binding\dylib.py in <module>
      1 from ctypes import c_void_p, c_char_p, c_bool, POINTER
      2 
----> 3 from llvmlite.binding import ffi
      4 from llvmlite.binding.common import _encode_string
      5 

~\miniconda3\lib\site-packages\llvmlite\binding\ffi.py in <module>
    189         break
    190 else:
--> 191     raise OSError("Could not load shared object file: {}".format(_lib_name))
    192 
    193 

OSError: Could not load shared object file: llvmlite.dll

but this doesn't happen if you run the python repl and run the import:

>>> import numba
>>> numba.__version__
'0.53.1'

The environment is miniconda with only numpy and numba installed.

> python -V
Python 3.9.1
  • I have tried using the latest released version of Numba (most recent is
    visible in the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
  • I have included a self contained code sample to reproduce the problem.
    i.e. it's possible to run as 'python bug.py'.
@stuartarchibald
Copy link
Contributor

Thanks for the report. Just to check, are the pythons in use on the terminal and inside jupyter exactly the same binary?

@stuartarchibald stuartarchibald added more info needed This issue needs more information and removed needtriage labels Apr 23, 2021
@scratchmex
Copy link
Author

image

image

@github-actions
Copy link

This issue is marked as stale as it has had no activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with any updates and confirm that this issue still needs to be addressed.

@github-actions github-actions bot added the stale Marker label for stale issues. label May 28, 2021
@ChenWuOtt
Copy link

ChenWuOtt commented Feb 23, 2022

I have the same problem for both numba and cupy.

I can import them from python, but cannot import them from Jupyter Lab. it gives:

ModuleNotFoundError Traceback (most recent call last)
Input In [1], in
----> 1 import numba
2 from numba import cuda as numba_cuba
3 from pyculib.fft import fft, ifft

ModuleNotFoundError: No module named 'numba'

But in Windows PS: I have

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS P:\Conda_FastBfft_project> python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
$ import numba
$ numba.version
'0.54.1'


@github-actions github-actions bot removed the stale Marker label for stale issues. label Feb 24, 2022
@ChenWuOtt
Copy link

@esc
Copy link
Member

esc commented Mar 3, 2022

@ChenWuOtt thank you for asking about this. The error message you are seeing and the one reported in this issue are different. For your error, it is likely that numba and jupyterlab are installed in different Python environments.

@github-actions
Copy link

github-actions bot commented Apr 3, 2022

This issue is marked as stale as it has had no activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with any updates and confirm that this issue still needs to be addressed.

@github-actions github-actions bot added the stale Marker label for stale issues. label Apr 3, 2022
@esc
Copy link
Member

esc commented Apr 4, 2022

Closing this issue as no new information has been provided. It is assumed that the above resolved the reported issue, if this is not the case please reopen the issue with new information. Many thanks.

@esc esc closed this as completed Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed This issue needs more information stale Marker label for stale issues.
Projects
None yet
Development

No branches or pull requests

4 participants