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

linux系统安装 paddlepaddle一直有gcc错误,请问有什么快捷解决方法吗? #2193

Closed
jiweizhangxu opened this issue May 17, 2022 · 4 comments
Assignees
Labels

Comments

@jiweizhangxu
Copy link

(paddle_fei) [root@czq-gpu uie]# /root/anaconda3/envs/paddle_fei/bin/pip install --upgrade paddlepaddle==2.3.0 -i https://mirror.baidu.com/pypi/simple
Looking in indexes: https://mirror.baidu.com/pypi/simple
Collecting paddlepaddle==2.3.0
Using cached https://mirror.baidu.com/pypi/packages/92/25/c4dc9ab8364e4a885580bff95603d9f7a6252662d948cbed2a44ac3916f2/paddlepaddle-2.3.0-cp39-cp39-manylinux1_x86_64.whl (112.4 MB)
Requirement already satisfied: numpy>=1.13 in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from paddlepaddle==2.3.0) (1.22.3)
Requirement already satisfied: requests>=2.20.0 in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from paddlepaddle==2.3.0) (2.27.1)
Collecting opt-einsum==3.3.0
Using cached https://mirror.baidu.com/pypi/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB)
Collecting astor
Using cached https://mirror.baidu.com/pypi/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl (27 kB)
Requirement already satisfied: decorator in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from paddlepaddle==2.3.0) (5.1.1)
Requirement already satisfied: protobuf>=3.1.0 in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from paddlepaddle==2.3.0) (3.20.1)
Collecting paddle-bfloat==0.1.2
Using cached https://mirror.baidu.com/pypi/packages/b6/a0/c5208e7814666ff80f5e846e37f31db971429e18d4f13eeea0633b281d5e/paddle_bfloat-0.1.2.tar.gz (553 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: six in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from paddlepaddle==2.3.0) (1.16.0)
Requirement already satisfied: Pillow in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from paddlepaddle==2.3.0) (9.1.0)
Requirement already satisfied: idna<4,>=2.5 in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from requests>=2.20.0->paddlepaddle==2.3.0) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from requests>=2.20.0->paddlepaddle==2.3.0) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from requests>=2.20.0->paddlepaddle==2.3.0) (1.26.9)
Requirement already satisfied: certifi>=2017.4.17 in /root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages (from requests>=2.20.0->paddlepaddle==2.3.0) (2021.10.8)
Building wheels for collected packages: paddle-bfloat
Building wheel for paddle-bfloat (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [61 lines of output]
/root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages/setuptools/dist.py:757: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running bdist_wheel
running build
running build_ext
building 'paddle_bfloat' extension
creating build
creating build/temp.linux-x86_64-3.9
gcc -pthread -B /root/anaconda3/envs/paddle_fei/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /root/anaconda3/envs/paddle_fei/include -I/root/anaconda3/envs/paddle_fei/include -fPIC -O2 -isystem /root/anaconda3/envs/paddle_fei/include -fPIC -I/root/anaconda3/envs/paddle_fei/include/python3.9 -I/root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages/numpy/core/include -c bfloat16.cc -o build/temp.linux-x86_64-3.9/bfloat16.o -std=c++11
bfloat16.cc:71:28: error: expected type-specifier
using Safe_PyObjectPtr = std::unique_ptr<PyObject, PyDecrefDeleter>;
^
bfloat16.cc:72:3: error: ‘Safe_PyObjectPtr’ does not name a type
Safe_PyObjectPtr make_safe(PyObject object)
^
bfloat16.cc: In function ‘bool paddle::{anonymous}::CastToBfloat16(PyObject
, paddle::{anonymous}::bfloat16*)’:
bfloat16.cc:180:5: error: ‘Safe_PyObjectPtr’ was not declared in this scope
Safe_PyObjectPtr ref;
^
bfloat16.cc:180:22: error: expected ‘;’ before ‘ref’
Safe_PyObjectPtr ref;
^
bfloat16.cc:184:53: error: ‘make_safe’ was not declared in this scope
ref = make_safe(PyArray_Cast(arr, npy_bfloat16));
^
bfloat16.cc:189:15: error: ‘std::ref’ does not have class type
arg = ref.get();
^
bfloat16.cc: In function ‘bool paddle::{anonymous}::RegisterUFunc(PyObject*, const char*)’:
bfloat16.cc:1023:4: error: ‘Safe_PyObjectPtr’ was not declared in this scope
Safe_PyObjectPtr ufunc_obj = make_safe(PyObject_GetAttrString(numpy, name));
^
bfloat16.cc:1023:21: error: expected ‘;’ before ‘ufunc_obj’
Safe_PyObjectPtr ufunc_obj = make_safe(PyObject_GetAttrString(numpy, name));
^
bfloat16.cc:1024:9: error: ‘ufunc_obj’ was not declared in this scope
if (!ufunc_obj)
^
bfloat16.cc:1028:61: error: ‘ufunc_obj’ was not declared in this scope
PyUFuncObject *ufunc = reinterpret_cast<PyUFuncObject *>(ufunc_obj.get());
^
bfloat16.cc: In function ‘bool paddle::Initialize()’:
bfloat16.cc:1742:3: error: ‘Safe_PyObjectPtr’ was not declared in this scope
Safe_PyObjectPtr numpy_str = make_safe(PyUnicode_FromString("numpy"));
^
bfloat16.cc:1742:20: error: expected ‘;’ before ‘numpy_str’
Safe_PyObjectPtr numpy_str = make_safe(PyUnicode_FromString("numpy"));
^
bfloat16.cc:1743:8: error: ‘numpy_str’ was not declared in this scope
if (!numpy_str)
^
bfloat16.cc:1747:20: error: expected ‘;’ before ‘numpy’
Safe_PyObjectPtr numpy = make_safe(PyImport_Import(numpy_str.get()));
^
bfloat16.cc:1748:8: error: ‘numpy’ was not declared in this scope
if (!numpy)
^
bfloat16.cc:1892:64: error: ‘numpy’ was not declared in this scope
RegisterUFunc<BinaryUFunc<bfloat16, bfloat16, ufuncs::Add>>(numpy.get(), "add") &&
^
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for paddle-bfloat
Running setup.py clean for paddle-bfloat
Failed to build paddle-bfloat
Installing collected packages: paddle-bfloat, opt-einsum, astor, paddlepaddle
Running setup.py install for paddle-bfloat ... error
error: subprocess-exited-with-error

× Running setup.py install for paddle-bfloat did not run successfully.
│ exit code: 1
╰─> [63 lines of output]
/root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages/setuptools/dist.py:757: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running install
/root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
building 'paddle_bfloat' extension
creating build
creating build/temp.linux-x86_64-3.9
gcc -pthread -B /root/anaconda3/envs/paddle_fei/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /root/anaconda3/envs/paddle_fei/include -I/root/anaconda3/envs/paddle_fei/include -fPIC -O2 -isystem /root/anaconda3/envs/paddle_fei/include -fPIC -I/root/anaconda3/envs/paddle_fei/include/python3.9 -I/root/anaconda3/envs/paddle_fei/lib/python3.9/site-packages/numpy/core/include -c bfloat16.cc -o build/temp.linux-x86_64-3.9/bfloat16.o -std=c++11
bfloat16.cc:71:28: error: expected type-specifier
using Safe_PyObjectPtr = std::unique_ptr<PyObject, PyDecrefDeleter>;
^
bfloat16.cc:72:3: error: ‘Safe_PyObjectPtr’ does not name a type
Safe_PyObjectPtr make_safe(PyObject object)
^
bfloat16.cc: In function ‘bool paddle::{anonymous}::CastToBfloat16(PyObject
, paddle::{anonymous}::bfloat16*)’:
bfloat16.cc:180:5: error: ‘Safe_PyObjectPtr’ was not declared in this scope
Safe_PyObjectPtr ref;
^
bfloat16.cc:180:22: error: expected ‘;’ before ‘ref’
Safe_PyObjectPtr ref;
^
bfloat16.cc:184:53: error: ‘make_safe’ was not declared in this scope
ref = make_safe(PyArray_Cast(arr, npy_bfloat16));
^
bfloat16.cc:189:15: error: ‘std::ref’ does not have class type
arg = ref.get();
^
bfloat16.cc: In function ‘bool paddle::{anonymous}::RegisterUFunc(PyObject*, const char*)’:
bfloat16.cc:1023:4: error: ‘Safe_PyObjectPtr’ was not declared in this scope
Safe_PyObjectPtr ufunc_obj = make_safe(PyObject_GetAttrString(numpy, name));
^
bfloat16.cc:1023:21: error: expected ‘;’ before ‘ufunc_obj’
Safe_PyObjectPtr ufunc_obj = make_safe(PyObject_GetAttrString(numpy, name));
^
bfloat16.cc:1024:9: error: ‘ufunc_obj’ was not declared in this scope
if (!ufunc_obj)
^
bfloat16.cc:1028:61: error: ‘ufunc_obj’ was not declared in this scope
PyUFuncObject *ufunc = reinterpret_cast<PyUFuncObject *>(ufunc_obj.get());
^
bfloat16.cc: In function ‘bool paddle::Initialize()’:
bfloat16.cc:1742:3: error: ‘Safe_PyObjectPtr’ was not declared in this scope
Safe_PyObjectPtr numpy_str = make_safe(PyUnicode_FromString("numpy"));
^
bfloat16.cc:1742:20: error: expected ‘;’ before ‘numpy_str’
Safe_PyObjectPtr numpy_str = make_safe(PyUnicode_FromString("numpy"));
^
bfloat16.cc:1743:8: error: ‘numpy_str’ was not declared in this scope
if (!numpy_str)
^
bfloat16.cc:1747:20: error: expected ‘;’ before ‘numpy’
Safe_PyObjectPtr numpy = make_safe(PyImport_Import(numpy_str.get()));
^
bfloat16.cc:1748:8: error: ‘numpy’ was not declared in this scope
if (!numpy)
^
bfloat16.cc:1892:64: error: ‘numpy’ was not declared in this scope
RegisterUFunc<BinaryUFunc<bfloat16, bfloat16, ufuncs::Add>>(numpy.get(), "add") &&
^
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> paddle-bfloat

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

@wawltor
Copy link
Collaborator

wawltor commented May 17, 2022

建议使用conda来安装环境
https://www.paddlepaddle.org.cn/
image

@jiweizhangxu
Copy link
Author

感谢,牛的

@wawltor wawltor self-assigned this May 18, 2022
@github-actions
Copy link

github-actions bot commented Jan 6, 2023

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

@github-actions github-actions bot added the stale label Jan 6, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants