Skip to content

Commit e7632dd

Browse files
committed
Add info to README and KB doc about ImportError: DLL load failed (cztomczak#359)
1 parent 0ddb343 commit e7632dd

File tree

2 files changed

+50
-5
lines changed

2 files changed

+50
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ also download packages for offline installation available on the
4747
pip install cefpython3==57.0
4848
```
4949

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

5256
See the [Tutorial.md](docs/Tutorial.md) file.
@@ -168,8 +172,8 @@ directly.
168172
- [Tutorial](docs/Tutorial.md)
169173

170174

171-
### API categories
172-
175+
### API categories
176+
173177
#### Modules
174178

175179
* [cefpython](api/cefpython.md#cefpython) module
@@ -224,9 +228,9 @@ directly.
224228
* [StringVisitor](api/StringVisitor.md#stringvisitor-interface) interface
225229
* [WebRequestClient](api/WebRequestClient.md#webrequestclient-interface) interface
226230

227-
228-
### API index
229-
231+
232+
### API index
233+
230234
* [Application settings](api/ApplicationSettings.md#application-settings)
231235
* [accept_language_list](api/ApplicationSettings.md#accept_language_list)
232236
* [auto_zooming](api/ApplicationSettings.md#auto_zooming)

docs/Knowledge-Base.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Knowledge Base
22

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

1920

21+
## ImportError: DLL load failed (Windows)
22+
23+
If you get such an error on Windows:
24+
```Text
25+
import cefpython3
26+
Traceback (most recent call last):
27+
File "<stdin>", line 1, in <module>
28+
File "C:\Python3\lib\site-packages\cefpython3\__init__.py", line 59, in <module>
29+
from . import cefpython_py36 as cefpython
30+
ImportError: DLL load failed: The specified module could not be found.
31+
```
32+
33+
Then most probably this is caused, because you are missing
34+
"msvcp140.dll" dependency (for Python 3 for example). This
35+
is a dependency for Python C++ extensions (eg. cefpython_py36.pyd
36+
depends on it). For Python 3 to fix this download
37+
[Visual C++ Redistributable for VS2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145)
38+
(13 MB) - this is just a VC++ redistributable, not a Visual Studio
39+
package. For 32-bit download "vc_redist.x86.exe" file and for
40+
64-bit download "vc_redist.x64.exe" file.
41+
42+
Explanation: msvcp140.dll is the DLL for the C++ runtime library.
43+
This dependency is added by Cython when building CEF Python
44+
module. It seems that Python 3.6 only ships "vcruntime140.dll"
45+
which is the DLL for the C runtime library.
46+
47+
Rant: It would be nice if Guido van Rossum would stop his
48+
academic approach to Python development and would not have
49+
created Python 3 incompatibility hell. It would also be nice
50+
if he shipped msvcp140.dll along with vcruntime140.dll, so
51+
that Python 3 supports C++ extensions as well.
52+
53+
On a side note, when using pyinstaller/py2exe tools for
54+
freezing application into exe then these tools should
55+
automatically detect the msvcp140.dll dependency and ship it
56+
with your application.
57+
58+
Created [Issue #359](../../issues/359) to track this problem.
59+
60+
2061
## Notifications about new releases / commits
2162

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

0 commit comments

Comments
 (0)