Skip to content Skip to sidebar Skip to footer

Module 'numba.findlib' Has No Attribute 'get_lib_dir'

I'm trying to learn how to use pyculib and got AttributeError: module 'numba.findlib' has no attribute 'get_lib_dir' 4 core CPU (intel) + GeForce GTX 745 File '', line 1, in

Solution 1:

Navigate to C:\Users\Administrator\Anaconda3\lib\site-packages\pyculib\sorting\ and make a back up of common.py. Replace the code in common.py with

from numba import findlib
import ctypes
import os
import platform
import warnings

def library_extension():
    p = platform.system()
    if p == 'Linux':
        return'so'if p == 'Windows':
        return'dll'if p == 'Darwin':
        return'dylib'

def load_lib(libname):
    fullname = 'pyculib_%s.%s' % (libname, library_extension())
    devlib = os.path.join(os.path.abspath(os.path.dirname(__file__)), fullname)
    ifos.path.exists(devlib):
        libpath = devlib
        warnings.warn('Using in-tree library %s' % libpath)
    else:
        libpath = os.path.join(findlib.get_lib_dirs()[0], fullname)

    return ctypes.CDLL(libpath)

If this dosent fix the problem revert to your backup

Solution 2:

The following steps solved the problem for me:

  1. Download anaconda 3-5.1.0
  2. Install numpy using conda install numpy=1.13.0
  3. Install cudatoolkit 7.5 using conda install cudatoolkit=7.5
  4. Install pyculib. If it works then every thing is ok, if you have an error like CURAND_STATUS_LAUNCH_FAILURE when using Anaconda Accelerate on GTX 1060 you can then:
  5. Install cudatoolkit=8.0 using conda install -c numba cudatoolkit=8.0

Post a Comment for "Module 'numba.findlib' Has No Attribute 'get_lib_dir'"