Tag Archives: DLL Load Failed

[Solved] Jupiter notebook failed to start Error: DLL load failed

Solution:

1. Check whether it is in the virtual environment

If you start the python virtual environment and run Jupiter notebook on the command line of the virtual environment, the above DLL load failed error will appear

So when you want to start Jupiter notebook in a virtual environment. First use PIP install Jupiter in a virtual environment

2. Check the configuration environment variables

Add the following two paths to the environment variable

import win32api; Importerror: DLL load failed: the specified program was not found

Error information

(venv) D:\pyvenv_xlwings64\venv>pip list
Package    Version
---------- -------
comtypes   1.1.7
pip        19.2.3
PyQt5      5.13.1
PyQt5-sip  4.19.19
pywin32    225
setuptools 41.2.0
wheel      0.33.6
xlwings    0.15.3

(venv) D:\pyvenv_xlwings64\venv>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlwings
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\pyvenv_xlwings64\venv\lib\site-packages\xlwings\__init__.py", line 42, in <module>
    from . import _xlwindows as xlplatform
  File "D:\pyvenv_xlwings64\venv\lib\site-packages\xlwings\_xlwindows.py", line 10, in <module>
    import win32api
ImportError: DLL load failed: the specified program was not found.
>>>

Cause of the problem

There is a problem with the new version 224 and 225. Just go back to version 223

(venv) D:\pyvenv_xlwings64\venv>pip install pywin32==223
Collecting pywin32==223
  Downloading https://files.pythonhosted.org/packages/9f/9d/f4b2170e8ff5d825cd4398856fee88f6c70c60bce0aa8411ed17c1e1b21f/pywin32-223-cp36-cp36m-win_amd64.whl (9.0MB)
     |████████████████████████████████| 9.0MB 218kB/s
Installing collected packages: pywin32
Successfully installed pywin32-223

(venv) D:\pyvenv_xlwings64\venv>
(venv) D:\pyvenv_xlwings64\venv>
(venv) D:\pyvenv_xlwings64\venv>
(venv) D:\pyvenv_xlwings64\venv>pip list
Package    Version
---------- -------
comtypes   1.1.7
pip        19.2.3
PyQt5      5.13.1
PyQt5-sip  4.19.19
pywin32    223
setuptools 41.2.0
wheel      0.33.6
xlwings    0.15.3

(venv) D:\pyvenv_xlwings64\venv>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlwings
>>> 

Python Importerror: DLL load failed: unable to find the specified module

Environmental description

Window 7, Python 3.6.5

Problem description

When importing based on python, the following error is reported:

>> from PIL import Image
Traceback (most recent call last):
  File "<ipython-input-12-0f6709e38f49>", line 1, in <module>
    from PIL import Image

  File "d:\ProgramData\Anaconda3\lib\site-packages\PIL\Image.py", line 58, in <module>
    from . import _imaging as core

ImportError: DLL load failed: unable to find the specified module.

Sometimes, similar errors are reported:

>> from PIL import Image
Traceback (most recent call last):

  File "<ipython-input-13-0f6709e38f49>", line 1, in <module>
    from PIL import Image

ImportError: cannot import name 'Image'

Problem analysis

This kind of problem is usually when installing the library, the security is not complete, or the installed library is covered or damaged, so the corresponding class library cannot be known.

Problem solving

C:\Users\xxxx\>pip install Pillow
Requirement already satisfied: Pillow in d:\programdata\anaconda3\lib\site-packages (5.0.0)


C:\Users\xxxx>pip show Pillow
Name: Pillow
Version: 5.2.0
Summary: Python Imaging Library (Fork)
Home-page: http://python-pillow.org
Author: Alex Clark (Fork Author)
Author-email: [email protected]
License: Standard PIL License
Location: d:\programdata\anaconda3\lib\site-packages
Requires:
Required-by:

It can be seen from the above instructions that the class library has been installed. However, due to its problems, it needs to be re installed
uninstall first

pip uninstall Pillow

Uninstalling Pillow-5.0.0:
  Would remove:
    d:\programdata\anaconda3\lib\site-packages\pillow-5.0.0.dist-info\*
Proceed (y/n)?y
  Successfully uninstalled Pillow-5.0.0

Then re install:

pip install Pillow

Collecting Pillow
  Downloading https://files.pythonhosted.org/packages/1b/50/869910cd7110157fbefd0fed3db3656c1951f1bceecdd00e3716aa269609/Pillow-5.2.0-cp36-cp36m-win_amd64.whl (1.6MB)
    100% |████████████████████████████████| 1.6MB 69kB/s
Installing collected packages: Pillow
Successfully installed Pillow-5.2.0

verification

Then re import the image to find that everything is OK.

Summary

If it has been installed but cannot be found, it is likely that the installation is damaged and needs to be re installed.