import cefpython3, throws DLL load failed

174 views
Skip to first unread message

afdal....@gmail.com

unread,
Apr 29, 2017, 3:52:12 AM4/29/17
to CEF Python
I just installed cefpython 3 using pip install cefpython3=57.0. I try to run hello_world example and it throws import error DLL load failed. Later i tried to import cefpython3 in python console and it throws the same error.

>>import cefpython3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\afdallismen\Envs\trial\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.
>>

I am running python 3.6.0 32bit with virtualenv on Windows 10 64bit.

Czarek Tomczak

unread,
Apr 29, 2017, 4:53:30 AM4/29/17
to CEF Python
Hello Afdal,

Check the C:\Users\afdallismen\Envs\trial\lib\site-packages\cefpython3\ directory whether all CEF and CEF Python binary files do exist in this location. Here is the full list:

-rw-rw-rw- 1 cz cz   283092 Apr 21 14:09 cef_100_percent.pak
-rw-rw-rw- 1 cz cz   396957 Apr 21 14:09 cef_200_percent.pak
-rw-rw-rw- 1 cz cz  3552095 Apr 21 14:09 cef_extensions.pak
-rw-rw-rw- 1 cz cz  6010288 Apr 21 14:09 cef.pak
-rw-rw-rw- 1 cz cz  1304064 Apr 21 14:09 cefpython_py27.pyd
-rw-rw-rw- 1 cz cz  1295872 Apr 21 14:09 cefpython_py34.pyd
-rw-rw-rw- 1 cz cz  1295360 Apr 21 14:09 cefpython_py35.pyd
-rw-rw-rw- 1 cz cz  1316352 Apr 21 14:09 cefpython_py36.pyd
-rw-rw-rw- 1 cz cz   434176 Apr 21 14:09 chrome_elf.dll
-rw-rw-rw- 1 cz cz  2106216 Apr 21 14:09 d3dcompiler_43.dll
-rw-rw-rw- 1 cz cz  3747512 Apr 21 14:09 d3dcompiler_47.dll
-rw-rw-rw- 1 cz cz        0 Apr 21 14:09 debug.log
-rw-rw-rw- 1 cz cz  4950251 Apr 21 14:09 devtools_resources.pak
drwxrwxr
-x 3 cz cz     4096 Apr 29 10:34 examples
-rw-rw-rw- 1 cz cz 10130464 Apr 21 14:09 icudtl.dat
-rw-rw-rw- 1 cz cz     2405 Apr 21 14:09 __init__.py
-rw-rw-rw- 1 cz cz 67109376 Apr 21 14:09 libcef.dll
-rw-rw-rw- 1 cz cz    79360 Apr 21 14:09 libEGL.dll
-rw-rw-rw- 1 cz cz  2246144 Apr 21 14:09 libGLESv2.dll
-rw-rw-rw- 1 cz cz     1915 Apr 21 14:09 License
-rw-rw-rw- 1 cz cz     1662 Apr 21 14:09 LICENSE.txt
drwxrwxr
-x 2 cz cz     4096 Apr 29 10:34 locales
-rw-rw-rw- 1 cz cz   334730 Apr 21 14:09 natives_blob.bin
-rw-rw-rw- 1 cz cz     5884 Apr 21 14:09 README.txt
-rw-rw-rw- 1 cz cz   962888 Apr 21 14:09 snapshot_blob.bin
-rw-rw-r-- 1 cz cz   280576 Apr 21 14:09 subprocess.exe
-rw-rw-rw- 1 cz cz   211456 Apr 21 14:09 widevinecdmadapter.dll

Maybe OS or Anti-Virus software blocked/removed some of these files?

I have checked the binary files and there are false positives only for this file:
- chrome_elf.dll 3/62 detection ratio: https://virustotal.com/en/file/c9c3ff6755342440044301504a6aa008e22ba7225e6a4d274339354adc4c0950/analysis/

All other files are fine:
- OK cef.pak https://virustotal.com/en/file/fcb82edf5f091f4a38e8c584ab98d0bcac40ea4280b685c1865def27c4f4b3d2/analysis/
- OK cef_100_percent.pak https://virustotal.com/en/file/f35ae0ad73ff5702a585a7c3c32d3d48a97be2d4702020a7f53124a807c673cb/analysis/
- OK cef_200_percent.pak https://virustotal.com/en/file/10589b62fa62782e26051a43366bab73604bdfa01b617209d70617a7179881e3/analysis/
- OK cef_extensions.pak https://virustotal.com/en/file/9c09beb2c5edc0b7a5e8b56c5f7d83a52dcca5b6d005b08dab2c460e7073ebfb/analysis/1493455531/
- OK cefpython_py27.pyd https://virustotal.com/en/file/58d97b57980aa348a1bdd3f1d334689ab87228001e9c48e6df13016d896bfdf8/analysis/1493455322/
- OK cefpython_py34.pyd https://virustotal.com/en/file/b10b98ca98964d811da0c881062736498157ea46fa3495b8141c7f54d45ecf44/analysis/
- OK cefpython_py35.pyd https://virustotal.com/en/file/b9f103d5ebfde4d6ea33446263e71e869eb9028ee3d67032373982a0226b5235/analysis/
- OK cefpython_py36.pyd https://virustotal.com/en/file/08193e3a15e0abfc2db77c6544a328330623eb3f1096ee648f43f4fb978a0b61/analysis/
- OK d3dcompiler_43.dll https://virustotal.com/en/file/2f23182ec6f4889397ac4bf03d62536136c5bdba825c7d2c4ef08c827f3a8a1c/analysis/
- OK d3dcompiler_47.dll https://virustotal.com/en/file/3a010ee7186086a7f77b6aec3644e05f8495a84895b90572cab8d4f14efa088e/analysis/
- OK devtools_resources.pak https://virustotal.com/en/file/f95a4fc8032bd0a8d5a2bdac652fa1cafa211f08b0e5cd8d723c4e052aa99b8c/analysis/1493455776/
- OK icudtl.dat https://virustotal.com/en/file/6747c6682cb478bb187c6ef856e0e79bcdc746c9c3d865aafd6182e62ca3f2ce/analysis/
- OK libcefl.dll https://virustotal.com/en/file/c6e36ffa8d62d1b1dc5131cd7af7f7c403e7d919715aae06ceed2a4c7ef00af8/analysis/
- OK libEGL.dll https://virustotal.com/en/file/56a49bd5753bdbb20e6c5027ef409a35822bb0d8bdd94a77ae379403c234662e/analysis/
- OK libGLESv2.dll https://virustotal.com/en/file/10353d594b5493ca6d275fce9ad0df896baf612407dc95f25de0a4c8941eb6e8/analysis/
- OK natives_blob.bin https://virustotal.com/en/file/2819552d00e290b999ea363ab3027bf5c07dd8265c2bc3488505080083923ea3/analysis/
- OK snapshot_blob.bin https://virustotal.com/en/file/8c057c387a380f721f7ae9f2fb66b5e0c3cce68be619e5e2531ebe73cdeb03dd/analysis/
- OK subprocess.exe https://virustotal.com/en/file/221328e67a4215bd94c4c7ca3d0ecbe0c80a28df76b23f2d18e3e47878a98f2e/analysis/
- OK widevinecdmadapter.dll https://virustotal.com/en/file/be9db2f662f66740ab129d27895cb9f940406d7413bafe34a93ab93752f59226/analysis/

Cheers.

Czarek Tomczak

unread,
Apr 29, 2017, 4:54:39 AM4/29/17
to CEF Python
Also what Python version / distribution are you using? Did you download from Pythong.org? Try the binaries from Python.org and see if it helps.

afdal....@gmail.com

unread,
Apr 29, 2017, 5:18:21 AM4/29/17
to CEF Python
All files is there. Also, because you mention security issue, i tried to turnoff windows defender and restart my computer, but its still throws same error.

I'm running python 3.6.0 32bit, installed from python .exe file i downloaded from python.org and installed cefpython on python 3.6.0 virtualenv.

Btw, what is DLL load error ? does cefpython tried to load a DLL file ? and somehow not finding it ?

Czarek Tomczak

unread,
Apr 29, 2017, 6:33:30 AM4/29/17
to CEF Python


from . import cefpython_py36 as cefpython

So it fails during importing of "cefpython_py36.pyd" module. But whether it fails to import that module or dependencies of that module - you don't know.

Please do this:
1. Check if this .pyd file exists and its size is correct - I have pasted in my first post sizes for all files.
2. Try installing cefpython3 package without virtualenv
3. Download Dependency Walker, run it and open "cefpython_py36.pyd" file to see its DLL dependencies. Are there any error messages saying that it can't file some dll depdendency?

Czarek Tomczak

unread,
Apr 29, 2017, 6:34:25 AM4/29/17
to CEF Python
>that it can't *find* some dll depdendency?

afdal....@gmail.com

unread,
Apr 29, 2017, 6:55:30 AM4/29/17
to CEF Python
hmm, .pyd files does exists and at same sizes. Reinstall without virtualenv still error. Installed dependency walker 2.2 32bit from dependencywalker.com, open cefpython_py36.pyd, and it shown many error. Some are API-MS-WIN-*, EXT-MS-WIN-*, MSVCP140.DLL and many more. How can i upload dependency walker results here ?

afdal....@gmail.com

unread,
Apr 29, 2017, 6:58:47 AM4/29/17
to CEF Python
error for those dependency are "Error opening files. The system cannot find the file specified(2)."

afdal....@gmail.com

unread,
Apr 29, 2017, 7:28:43 AM4/29/17
to CEF Python

Czarek Tomczak

unread,
Apr 29, 2017, 7:31:19 AM4/29/17
to CEF Python
Looks like the issue is you're missing VC++ redistributable package for VS2015 (msvcp140.dll) - for 32-bit. Since Python 3.6 is build using Visual Studio 2015, I think it should ship that dll with its installer. The VC++ redistributable is just a dependency DLL, not a Visual Studio package iself.

Try installing latest Python 3.6.1 stable from Python.org. Maybe you're using some broken version which is not stable.

Check your Python installation directory and its subdirs and see if msvcp140.dll is available there.

If Python does not ship that dll that would be strange. It might be a case that this is required for Python C extensions to install this dll separately. I am not sure shippinhg these dlls along with cefpython is a good idea, because there might be different versions of this DLL in your system and already loaded by other C extensions.

I think that pyinstaller/py2exe should ship such msvcp140.dll dependency automatically when you freeze your applicatoin to exe.

Try also searching Google for "Python 3.6 msvcp140.dll".

Czarek Tomczak

unread,
Apr 29, 2017, 7:33:08 AM4/29/17
to CEF Python
Please make a screenshot, because I am currently using Linux and can't load .dwi file.

afdal....@gmail.com

unread,
Apr 29, 2017, 7:39:33 AM4/29/17
to CEF Python
hmm, I am never used pyinstaller/py2exe, and never freeze any application to exe, I just installed cefpython using pip install cefpython3==57.0, and tried to import it in python console.

Czarek Tomczak

unread,
Apr 29, 2017, 7:47:16 AM4/29/17
to CEF Python
There seems to be something wrong with your environment. I gave you hints. Try installing the VC++ dependency. Install latest stable Python. Try running an example instead of a python console and see if it makes any difference.

afdal....@gmail.com

unread,
Apr 29, 2017, 7:55:41 AM4/29/17
to CEF Python
Here is ss from dependency walker : https://drive.google.com/open?id=0B57zY6JtDomqSHRyam84OGhnNms, I compress it to zip because ss take 12 images. What VC++ dependencies that could be ?

afdal....@gmail.com

unread,
Apr 29, 2017, 7:57:18 AM4/29/17
to CEF Python
sorry the ss is bigger than it should be, I just copy-paste it to paint.

Czarek Tomczak

unread,
Apr 29, 2017, 8:03:40 AM4/29/17
to CEF Python
Please read carefully my previous posts, I already gave you link to VC++ redist.

afdal....@gmail.com

unread,
Apr 29, 2017, 8:27:28 AM4/29/17
to CEF Python
wow, installing VC++ redist with the link you gave me fix it. I am able to import cefpython3 and running hello world from examples directory. But when I tried running dependency walker again, it still showing lots of error. Thank you for your support means a lot to me :D.

Czarek Tomczak

unread,
Apr 29, 2017, 8:34:23 AM4/29/17
to CEF Python
These other errors may be just "possible" errors, you can ignore them. You only need that VC++ redist.

It is a mystery to me why this wasn't installed by default. Maybe its a Py 3 bug or maybe Guido van Rossum continues his academic approach to Python development. This dll should be shipped by default, it doesn't make sense not to ship it. It doesn't make sense for each Python C extension to ship this dll separately.

afdal....@gmail.com

unread,
Apr 29, 2017, 8:41:31 AM4/29/17
to CEF Python
Maybe I have them uninstalled. I just uninstalled Delphi and several of its package before through windows control panel maybe VC++ was one of them.

afdal....@gmail.com

unread,
Apr 29, 2017, 8:45:45 AM4/29/17
to CEF Python
Btw, i have vcruntime140.dll in my python installation directory, but no msvcp140.dll.

Czarek Tomczak

unread,
Apr 29, 2017, 8:50:33 AM4/29/17
to CEF Python
Ahhh. So looks like this might be a dependency added by Cython. It still is a mystery
why Python only ships vcruntime140.dll when Microsoft provides VC++ redist as a package,
that installs both vcruntime140.dll and msvcp140.dll and that is how Python should ship
it otherwise they probably violate Microsoft license.

From stackoverflow:
msvcrXXXX.dll is the DLL for the C runtime library. msvcpXXXX.dll is the DLL for the C++ runtime library.
Reply all
Reply to author
Forward
0 new messages