Protobuf: Python Importerror, _message could not be found

Created on 12 Mar 2018  路  21Comments  路  Source: protocolbuffers/protobuf

File "..\anaconda2\lib\site-packages\google\protobuf\descriptor.py", line 46, in
from google.protobuf.pyext import _message
importError: DLL load failed: The specified module could not be found.

I am trying to install pb in windows, which worked well couple months ago, but the error occurs this time and I noticed _message.pyd is a 'new' file in pyext compared to the last installation.

Not sure about the reason causing the problem. Please help take a look.

bug packaging & distribution python

All 21 comments

I also have this problem using protobuf-3.5.2-cp27-cp27m-win_amd64.whl on Windows.

To reproduce all I need to do is:

from google.protobuf.pyext import _message

I opened site-packages\google\protobuf\pyext\_message.pyd using DependencyWalker and it reported that it could not find the following modules:

LIBGCC_S_SEH-1.DLL
MSVCR90.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
DCOMP.DLL
IESHIMS.DLL

@TeBoring Can you check if the python wheels work on windows?

I am having the same problem on line 46 of descriptor.py.

@stephenbarton could you also provide similar info as provided by @emddudley

LIBGCC_S_SEH-1.DLL
LIBSTDC++-6.DLL
MSVCR90.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
DCOMP.DLL
GPSVC.DLL
IESHIMS.DLL

@emddudley Does python3.5 also fail?

@stephenbarton Does python3.5 also fail?

The calling program does not support Python3 yet.

@stephenbarton, @emddudley If I push a new wheel to testpypi.python.org, could you help test?

Could you also check do you have MSVCR90.dll on your system?

According to https://wiki.python.org/moin/WindowsCompilers, cpyton2.7 user needs to install vc9.0. Do you have vc9.0 in your environment?

I can help test if you push up a new wheel.

I do not have msvcr90.dll or vcruntime90.dll on my system. Since I am installing from wheels, does it matter? I do have:

msvcr71.dll
msvcr100.dll
msvcr110.dll
msvcr120.dll
vcruntime140.dll

Testing from google.protobuf.pyext import _message in various interpreters on Windows (64-bit)...

Wheel | Python | Result
----- | ------ | ------
protobuf-3.5.2-cp27-cp27m-win32.whl | 2.7.10 (32-bit) | Fails
protobuf-3.5.2-cp27-cp27m-win_amd64.whl | 2.7.10 (64-bit) | Fails
protobuf-3.5.2-cp35-cp35m-win32.whl | 3.5.4 (32-bit) | Succeeds
protobuf-3.5.2-cp35-cp35m-win_amd64.whl | 3.5.4 (64-bit) | Succeeds
protobuf-3.5.2-cp36-cp36m-win32.whl | 3.6.4 (32-bit) | Succeeds
protobuf-3.5.2-cp36-cp36m-win_amd64.whl | 3.6.4 (64-bit) | Succeeds

@emddudley, for python2.7 to work, you have to install vc9.0 (https://wiki.python.org/moin/WindowsCompilers). Previously, we use cygwin to build py2.7 and py3.4. I guess that's the reason for failing. I will try to use msvc to build. But anyway, you still need vc9.0 to make py2.7 work with non-pure python module.

I found that I only have vcruntime140.dll.
Thanks for your assistance.
I found a standalone version of the utility that I am trying to run so I think I am ok for now.

I won't be able to check the file until next Monday, will update then. Thank you for the information!

@TeBoring So this new requirement stems from using msvc instead of cygwin to compile the protobuf wheels? This is the first package I've used that requires the VC 9.0 runtime to be installed.

This is an unexpected breaking change. I will no longer be able to install my packages via pip alone, and I will have to provide additional instruction to my users on how to install the VC 9.0 runtime.

Secondly, the requirement for the VC 9.0 runtime is not documented. There are no installation instructions on PyPI. How will a new user know that the VC 9.0 runtime is required? I am actually having trouble finding out where I can obtain this DLL... it doesn't get installed with the Microsoft Visual C++ 2008 and 2008 SP1 Redistributable Packages.

Ah, I think the redistributable packages install the required DLLs under WinSxS:

C:\Windows\winsxs\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251\msvcr90.dll

I still get the DLL load failed error from protobuf, even after installing the following and rebooting:

I was not able to install Microsoft .NET Framework 3.5 SP1 but I am doubtful that it would help.

I have uploaded new wheels to https://testpypi.python.org/pypi/protobuf/3.5.2.post1. Please have a try.

Thank you for your support @TeBoring , the new wheels work in all of my test cases!

Wheel | Python | Result
----- | ------ | ------
protobuf-3.5.2.post1-cp27-cp27m-win32.whl | 2.7.10 (32-bit) | Success
protobuf-3.5.2.post1-cp27-cp27m-win_amd64.whl | 2.7.10 (64-bit) | Success
protobuf-3.5.2.post1-cp35-cp35m-win32.whl | 3.5.1 (32-bit) | Success
protobuf-3.5.2.post1-cp35-cp35m-win_amd64.whl | 3.5.4 (64-bit) | Success
protobuf-3.5.2.post1-cp36-cp36m-win32.whl | 3.6.4 (32-bit) | Success
protobuf-3.5.2.post1-cp36-cp36m-win_amd64.whl | 3.6.1 (64-bit) | Success

I have uploaded wheels to pypi: https://pypi.python.org/pypi/protobuf/3.5.2.post1

@emddudley Could you help take a look of #5046. We tried to use a new way to build the wheel and may have some problems.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cl51287 picture cl51287  路  29Comments

tang3w picture tang3w  路  39Comments

blowmage picture blowmage  路  26Comments

mkosieradzki picture mkosieradzki  路  70Comments

little-dude picture little-dude  路  88Comments