老卫带你学---from google.protobuf.pyext import _message ImportError: DLL load failed: 找不到指定的程序。

导入tensorflow这个模块时,安装已经成功,导入也没抱错,但是在运行时出现了以下错误
在这里插入图片描述
解决办法:
在自动安装了tensorflow时, protobuf安装的是最新版本3.7.1, 出现了不兼容的问题。
我们只要把protobuf的版本改为3.6.0就解决了,如果第一次执行这条命令,执行到一半出现错误,可以尝试再次执行下面这条命令再次安装

 pip install protobuf==3.6.0  
引用\[1\]: 这个错误是由于在导入tensorflow包时出现了问题。可能是由于tensorflow和protobuf版本不兼容导致的。你可以尝试检查一下protoc和protobuf的版本是否一致,并确保它们是兼容的。你可以在Anaconda Prompt中使用命令`protoc --version`和`pip show protobuf`来查看它们的版本。如果版本不一致,你可以尝试安装相同版本的protobuf来解决问题。如果版本一致但问题仍然存在,你可以尝试下面的解决方法。 引用\[2\]: 另一个可能的解决方法是在源文件中添加一行代码。你可以到`google/protobuf/internal/container.py`文件,并在其中添加以下代码:`from collections.abc import MutableMapping`。这个代码的作用是导入`MutableMapping`类,以解决`AttributeError: module 'google.protobuf.internal.containers' has no attribute 'MutableMapping'`错误。 引用\[3\]: 这个错误可能是由于protobuf版本过低或者protobuf只支持Python 2.x导致的。你可以尝试使用`pip install protobuf-py3`和`pip install --upgrade protobuf`命令来安装或升级protobuf库。这样可以确保你使用的是适用于Python 3的protobuf版本。如果问题仍然存在,你可以尝试其他解决方法或者查更多关于这个错误的信息来解决问题。 综上所述,你可以尝试检查和更新protobuf版本,或者在源文件中添加必要的代码来解决这个错误。 #### 引用[.reference_title] - *1* *3* [【ERROR】TypeError: expected bytes, Descriptor found](https://blog.csdn.net/ccbrid/article/details/103425627)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [问题解决 AttributeError: module ‘google.protobuf.internal.containers‘ has no attribute ...](https://blog.csdn.net/qq_43865022/article/details/124402242)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值