Skip to content
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

M1 mac安装paddle后import时报错 #43188

Closed
xiehuanyi opened this issue Jun 3, 2022 · 5 comments
Closed

M1 mac安装paddle后import时报错 #43188

xiehuanyi opened this issue Jun 3, 2022 · 5 comments
Assignees
Labels
status/following-up 跟进中 type/build 编译/安装问题

Comments

@xiehuanyi
Copy link

问题描述 Issue Description

Traceback (most recent call last):
File "/Volumes/Samsung_T5/PycharmProjects/Sign-GPT/test.py", line 1, in
import paddle
File "/Volumes/Samsung_T5/Resume-master/Sign-GPT/lib/python3.9/site-packages/paddle/init.py", line 25, in
from .framework import monkey_patch_variable
File "/Volumes/Samsung_T5/Resume-master/Sign-GPT/lib/python3.9/site-packages/paddle/framework/init.py", line 17, in
from . import random # noqa: F401
File "/Volumes/Samsung_T5/Resume-master/Sign-GPT/lib/python3.9/site-packages/paddle/framework/random.py", line 16, in
import paddle.fluid as fluid
File "/Volumes/Samsung_T5/Resume-master/Sign-GPT/lib/python3.9/site-packages/paddle/fluid/init.py", line 36, in
from . import framework
File "/Volumes/Samsung_T5/Resume-master/Sign-GPT/lib/python3.9/site-packages/paddle/fluid/framework.py", line 35, in
from .proto import framework_pb2
File "/Volumes/Samsung_T5/Resume-master/Sign-GPT/lib/python3.9/site-packages/paddle/fluid/proto/framework_pb2.py", line 33, in
_descriptor.EnumValueDescriptor(
File "/Volumes/Samsung_T5/Resume-master/Sign-GPT/lib/python3.9/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:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

版本&环境信息 Version & Environment Information


Paddle version: None
Paddle With CUDA: None

OS: macOs 12.4
Python version: 3.9.2

CUDA version: None
cuDNN version: None.None.None
Nvidia driver version: None


@xiehuanyi xiehuanyi added status/new-issue 新建 type/build 编译/安装问题 labels Jun 3, 2022
@paddle-bot-old
Copy link

paddle-bot-old bot commented Jun 3, 2022

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

@xiehuanyi
Copy link
Author

官网上说安装unrar,但是我没法安装
Warning: No available formula with the name "unrar". Did you mean unar?
==> Searching for similarly named formulae...
This similarly named formula was found:
unar
To install it, run:
brew install unar
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

@SigureMo
Copy link
Member

SigureMo commented Jun 4, 2022

#43052

另外报错信息也很清楚了

Downgrade the protobuf package to 3.20.x or lower.

降级到 3.20 及以下即可

pip install protobuf==3.20.1

@SigureMo
Copy link
Member

SigureMo commented Jun 4, 2022

官网上说安装unrar,但是我没法安装

我怎么记得自行编译才需要安装这个,如果一定要安装的话,现在 Homebrew 可以通过安装 rar 一并安装 rar 和 unrar

brew install rar

@paddle-bot
Copy link

paddle-bot bot commented Jun 13, 2023

Since you haven't replied for more than a year, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
由于您超过一年未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/following-up 跟进中 type/build 编译/安装问题
Projects
None yet
Development

No branches or pull requests

3 participants