Skip to content

Commit

Permalink
Add info to README and KB doc about ImportError: DLL load failed (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomczak committed Apr 29, 2017
1 parent 0ddb343 commit e7632dd
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ also download packages for offline installation available on the
pip install cefpython3==57.0
```

If you get an error when importing the cefpython3 package on
Windows then see this section in the Knowledge Base document:
[ImportError: DLL load failed (Windows)](docs/Knowledge-Base.md#importerror-dll-load-failed-windows).

## Tutorial

See the [Tutorial.md](docs/Tutorial.md) file.
Expand Down Expand Up @@ -168,8 +172,8 @@ directly.
- [Tutorial](docs/Tutorial.md)


### API categories

### API categories

#### Modules

* [cefpython](api/cefpython.md#cefpython) module
Expand Down Expand Up @@ -224,9 +228,9 @@ directly.
* [StringVisitor](api/StringVisitor.md#stringvisitor-interface) interface
* [WebRequestClient](api/WebRequestClient.md#webrequestclient-interface) interface


### API index


### API index

* [Application settings](api/ApplicationSettings.md#application-settings)
* [accept_language_list](api/ApplicationSettings.md#accept_language_list)
* [auto_zooming](api/ApplicationSettings.md#auto_zooming)
Expand Down
41 changes: 41 additions & 0 deletions docs/Knowledge-Base.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Knowledge Base

Table of contents:
* [ImportError: DLL load failed (Windows)](#importerror-dll-load-failed-windows)
* [Notifications about new releases / commits](#notifications-about-new-releases--commits)
* [Changes in API after CEF updates](#changes-in-api-after-cef-updates)
* [Differences between Python 2 and Python 3](#differences-between-python-2-and-python-3)
Expand All @@ -17,6 +18,46 @@ Table of contents:
* [Security](#security)


## ImportError: DLL load failed (Windows)

If you get such an error on Windows:
```Text
import cefpython3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python3\lib\site-packages\cefpython3\__init__.py", line 59, in <module>
from . import cefpython_py36 as cefpython
ImportError: DLL load failed: The specified module could not be found.
```

Then most probably this is caused, because you are missing
"msvcp140.dll" dependency (for Python 3 for example). This
is a dependency for Python C++ extensions (eg. cefpython_py36.pyd
depends on it). For Python 3 to fix this download
[Visual C++ Redistributable for VS2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145)
(13 MB) - this is just a VC++ redistributable, not a Visual Studio
package. For 32-bit download "vc_redist.x86.exe" file and for
64-bit download "vc_redist.x64.exe" file.

Explanation: msvcp140.dll is the DLL for the C++ runtime library.
This dependency is added by Cython when building CEF Python
module. It seems that Python 3.6 only ships "vcruntime140.dll"
which is the DLL for the C runtime library.

Rant: It would be nice if Guido van Rossum would stop his
academic approach to Python development and would not have
created Python 3 incompatibility hell. It would also be nice
if he shipped msvcp140.dll along with vcruntime140.dll, so
that Python 3 supports C++ extensions as well.

On a side note, when using pyinstaller/py2exe tools for
freezing application into exe then these tools should
automatically detect the msvcp140.dll dependency and ship it
with your application.

Created [Issue #359](../../issues/359) to track this problem.


## Notifications about new releases / commits

To be notified of new releases subscribe to this [RSS/Atom feed](../../../releases.atom).
Expand Down

0 comments on commit e7632dd

Please sign in to comment.