-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于安装paddle 发行版本遇到protobuf 的报错问题 #43052
Comments
protobuf 已经撤销了4.21 版本在pypi源上的发布( https://pypi.org/project/protobuf/4.21.0/ ) ,如果你使用pip install paddlepaddle 默认从pypi源下载依赖的话不会再遇到import paddle 报错,但是你从国内源下载(清华源、百度源等),则依然会下载protobuf 4.x,需要手动降低版本再使用paddle |
我也遇到了这一问题,但是当我手动降低版本后会出现 |
yank 的第二天就发布了 4.21.1,所以还会有这个问题 另外,降级是有效的(如 3.20.1),不会出现其他问题 |
这问题与此无关吧,建议另开 issue 详述问题 |
pip install protobuf==3.20.1 -i https://pypi.tuna.tsinghua.edu.cn/simple |
Since you haven't replied for more than a year, we have closed this issue/pr. |
问题描述 Please describe your issue
问题原因:
protobuf 于 2022.05.26 发布了 4.21 版本,如果您环境中没有 protobuf 的话,默认安装 paddle 时会自动下载最高版本的protobuf 4.21,paddle能安装成功但是 import paddle 会报错,这是由于protobuf 4.21 为不兼容升级,目前 develop 版本的 paddle 已经修复了这个问题( see #43009 ),但是发行版由于已经编包发布所以仍存在这个问题,飞桨会在下个版本2.3.1中解决。
参考:
解决办法:
手动降低 protobuf 为 3.x
pip install protobuf==3.20.1
完整报错:
(py39) C:\Users\Admin>hub install ge2e_fastspeech2_pwgan==1.0.0
Traceback (most recent call last):
File "f:\anaconda3\envs\py39\lib\runpy.py", line 197, in run_module_as_main
return run_code(code, main_globals, None,
File "f:\anaconda3\envs\py39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "f:\anaconda3\envs\py39\Scripts\hub.exe_main.py", line 4, in
File "f:\anaconda3\envs\py39\lib\site-packages\paddlehub_init.py", line 18, in
import paddle
File "f:\anaconda3\envs\py39\lib\site-packages\paddle_init.py", line 25, in
from .framework import monkey_patch_variable
File "f:\anaconda3\envs\py39\lib\site-packages\paddle\framework_init_.py", line 17, in
from . import random # noqa: F401
File "f:\anaconda3\envs\py39\lib\site-packages\paddle\framework\random.py", line 16, in
import paddle.fluid as fluid
File "f:\anaconda3\envs\py39\lib\site-packages\paddle\fluid_init_.py", line 36, in
from . import framework
File "f:\anaconda3\envs\py39\lib\site-packages\paddle\fluid\framework.py", line 35, in
from .proto import framework_pb2
File "f:\anaconda3\envs\py39\lib\site-packages\paddle\fluid\proto\framework_pb2.py", line 33, in
_descriptor.EnumValueDescriptor(
File "f:\anaconda3\envs\py39\lib\site-packages\google\protobuf\descriptor.py", line 755, in new
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
The text was updated successfully, but these errors were encountered: