Error importing deeplabcut in windows (Module not found)

I created the conda environment using the provided dlc-windowsGPU.yaml file and I have been able to import and test tensorflow. However, when I try to import deeplabcut to start the project, the following error pops-up:

(dlc-windowsGPU) C:\>ipython
Python 3.6.8 |Anaconda, Inc.| (default, Feb 11 2019, 15:03:47) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.0.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import deeplabcut
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-52d2df9c7fa5> in <module>()
----> 1 import deeplabcut

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\_init_.py in <module>()
     23 else:
     24     mpl.use('TkAgg')
---> 25     from deeplabcut import generate_training_dataset
     26     from deeplabcut import refine_training_dataset
     27

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\generate_training_dataset\_init_.py in <module>()
     14 else:
     15     from deeplabcut.generate_training_dataset.auxfun_drag_label import *
---> 16     from deeplabcut.generate_training_dataset.labeling_toolbox import *
     17     from deeplabcut.generate_training_dataset.frame_extraction_toolbox import *
     18

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\generate_training_dataset\labeling_toolbox.py in <module>()
     25 from deeplabcut.generate_training_dataset import auxfun_drag_label
     26 import wx.lib.scrolledpanel as SP
---> 27 from deeplabcut.utils import auxiliaryfunctions
     28 from mpl_toolkits.axes_grid1 import make_axes_locatable
     29 from skimage import io

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\utils\_init_.py in <module>()
----> 1 from deeplabcut.utils.make_labeled_video import *
      2 from deeplabcut.utils.auxiliaryfunctions import *
      3 from deeplabcut.utils.video_processor import *
      4 from deeplabcut.utils.plotting import *
      5

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\utils\make_labeled_video.py in <module>()
     33
     34 from deeplabcut.utils import auxiliaryfunctions
---> 35 from deeplabcut.pose_estimation_tensorflow.config import load_config
     36 from skimage.util import img_as_ubyte
     37 from skimage.draw import circle_perimeter, circle

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\_init_.py in <module>()
     13 """
     14
---> 15 from deeplabcut.pose_estimation_tensorflow.dataset import *
     16 from deeplabcut.pose_estimation_tensorflow.models import *
     17 from deeplabcut.pose_estimation_tensorflow.nnet import *

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\dataset\_init_.py in <module>()
     12 Pose_Estimation_Tensorflow is based of Eldar's repository.
     13 """
---> 14 from deeplabcut.pose_estimation_tensorflow.dataset.factory import *
     15 from deeplabcut.pose_estimation_tensorflow.dataset.pose_dataset import *

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\dataset\factory.py in <module>()
      4 '''
      5
----> 6 from deeplabcut.pose_estimation_tensorflow.dataset.pose_dataset import PoseDataset
      7
      8 def create(cfg):

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\dataset\pose_dataset.py in <module>()
     12 from numpy import concatenate as cat
     13
---> 14 import scipy.io as sio
     15 from scipy.misc import imread, imresize
     16

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\io\_init_.py in <module>()
     95
     96 # matfile read and write
---> 97 from .matlab import loadmat, savemat, whosmat, byteordercodes
     98
     99 # netCDF file support

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\io\matlab\_init_.py in <module>()
     11
     12 # Matlab file read and write utilities
---> 13 from .mio import loadmat, savemat, whosmat
     14 from . import byteordercodes
     15

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\io\matlab\mio.py in <module>()
     10 from scipy._lib.six import string_types
     11
---> 12 from .miobase import get_matfile_version, docfiller
     13 from .mio4 import MatFile4Reader, MatFile4Writer
     14 from .mio5 import MatFile5Reader, MatFile5Writer

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\io\matlab\miobase.py in <module>()
     20     byteord = ord
     21
---> 22 from scipy.misc import doccer
     23
     24 from . import byteordercodes as boc

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\misc\_init_.py in <module>()
     66 from numpy import who as _who, source as _source, info as _info
     67 import numpy as np
---> 68 from scipy.interpolate._pade import pade as _pade
     69 from scipy.special import (comb as _comb, logsumexp as _lsm,
     70         factorial as _fact, factorial2 as _fact2, factorialk as _factk)

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\interpolate\_init_.py in <module>()
    173 from _future_ import division, print_function, absolute_import
    174
--> 175 from .interpolate import *
    176 from .fitpack import *
    177

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\interpolate\interpolate.py in <module>()
     18                    dot, ravel, poly1d, asarray, intp)
     19
---> 20 import scipy.linalg
     21 import scipy.special as spec
     22 from scipy.special import comb

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\linalg\_init_.py in <module>()
    188 from .linalg_version import linalg_version as _version_
    189
--> 190 from .misc import *
    191 from .basic import *
    192 from .decomp import *

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\linalg\misc.py in <module>()
      3 import numpy as np
      4 from numpy.linalg import LinAlgError
----> 5 from .blas import get_blas_funcs
      6 from .lapack import get_lapack_funcs
      7

c:\users\phoenix\anaconda3\envs\dlc-windowsgpu\lib\site-packages\scipy\linalg\blas.py in <module>()
    212 import numpy as _np
    213
--> 214 from scipy.linalg import _fblas
    215 try:
    216     from scipy.linalg import _cblas

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

I have tried uninstalling deeplabcut and reinstalling (both using the pip install --ignore-installed, -pip install deeplabcut==2.0.4.1, and even importing it from within the Deeplabcut-Master folder).
I have also added to the PATH in the environment variables the direction of every deeplabcut folder (located within the Anaconda3 environment).

Can you please help me to solve this issue? What else can I try?

Kind regards,

yes, this seems not to be a true DLC error, but unfortunately something we are seeing with many packages on freshly installed Anaconda + Windows systems … seems to be a system env related, perhaps PATH error: Tensorflow DLC 2.0 ImportError: DLL load failed: The specified module could not be found Maybe follow those instructions and see how it goes…

Thanks a lot. It was indeed solved by using:

conda install msvc_runtime

2 Likes