ubuntu中error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status

本文介绍如何在Linux环境下安装Python及对应的开发库,通过使用sudo apt-get install命令,可轻松完成python-dev和python3-dev的安装,有效解决开发过程中遇到的依赖问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装好python环境之后顺便安装对应版本的dev,例如:

sudo apt-get install python-dev python3-dev

基本可以解决所有安装的问题

(timbrewatermark) root@autodl-container-5e64478fe3-5fbcb1e5:~/autodl-tmp/TimbreWatermarking-main/watermarking_model# pip install pypesq==1.2.4 Looking in indexes: http://mirrors.aliyun.com/pypi/simple Collecting pypesq==1.2.4 Using cached http://mirrors.aliyun.com/pypi/packages/c7/e7/97ef80281de134be48b352bb63218a5f92f96c5bce32f37e8e288d253eff/pypesq-1.2.4.tar.gz (30 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: numpy in /root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages (from pypesq==1.2.4) (1.24.2) Building wheels for collected packages: pypesq Building wheel for pypesq (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [103 lines of output] /root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/setuptools/installer.py:34: UserWarning: Module numpy was already imported from /root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/__init__.py, but /tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef is being added to sys.path import pkg_resources # Delay import to avoid unnecessary side-effects /root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/setuptools/__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !! ******************************************************************************** Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. ******************************************************************************** !! dist.fetch_build_eggs(dist.setup_requires) running bdist_wheel running build running build_py file numpy.py (for module numpy) not found creating build/lib.linux-x86_64-cpython-38/pypesq copying pypesq/__init__.py -> build/lib.linux-x86_64-cpython-38/pypesq file numpy.py (for module numpy) not found running build_ext building 'pesq_core' extension creating build/temp.linux-x86_64-cpython-38/pypesq gcc -pthread -B /root/miniconda3/envs/timbrewatermark/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipypesq -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy -I/root/miniconda3/envs/timbrewatermark/include/python3.8 -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include -c pypesq/dsp.c -o build/temp.linux-x86_64-cpython-38/pypesq/dsp.o gcc -pthread -B /root/miniconda3/envs/timbrewatermark/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipypesq -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy -I/root/miniconda3/envs/timbrewatermark/include/python3.8 -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include -c pypesq/pesq.c -o build/temp.linux-x86_64-cpython-38/pypesq/pesq.o In file included from /root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940, from /root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5, from pypesq/pesq.c:2: /root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 17 | #warning "Using deprecated NumPy API, disable it with " \ | ^~~~~~~ pypesq/pesq.c: In function ‘_pesq’: pypesq/pesq.c:61:34: warning: passing argument 1 of ‘compute_pesq’ from incompatible pointer type [-Wincompatible-pointer-types] 61 | float pesq = compute_pesq(ref->data, deg->data, ref->dimensions[0], deg->dimensions[0], fs); | ~~~^~~~~~ | | | char * In file included from pypesq/pesq.c:5: pypesq/pesq.h:287:28: note: expected ‘short int *’ but argument is of type ‘char *’ 287 | float compute_pesq(short * ref, short * deg, long ref_n_samples, long deg_n_samples, long fs); | ~~~~~~~~^~~ pypesq/pesq.c:61:45: warning: passing argument 2 of ‘compute_pesq’ from incompatible pointer type [-Wincompatible-pointer-types] 61 | float pesq = compute_pesq(ref->data, deg->data, ref->dimensions[0], deg->dimensions[0], fs); | ~~~^~~~~~ | | | char * In file included from pypesq/pesq.c:5: pypesq/pesq.h:287:41: note: expected ‘short int *’ but argument is of type ‘char *’ 287 | float compute_pesq(short * ref, short * deg, long ref_n_samples, long deg_n_samples, long fs); | ~~~~~~~~^~~ gcc -pthread -B /root/miniconda3/envs/timbrewatermark/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipypesq -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy -I/root/miniconda3/envs/timbrewatermark/include/python3.8 -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include -c pypesq/pesqdsp.c -o build/temp.linux-x86_64-cpython-38/pypesq/pesqdsp.o gcc -pthread -B /root/miniconda3/envs/timbrewatermark/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipypesq -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy -I/root/miniconda3/envs/timbrewatermark/include/python3.8 -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include -c pypesq/pesqio.c -o build/temp.linux-x86_64-cpython-38/pypesq/pesqio.o pypesq/pesqio.c: In function ‘load_src’: pypesq/pesqio.c:200:10: warning: unused variable ‘s’ [-Wunused-variable] 200 | char s; | ^ pypesq/pesqio.c:198:10: warning: unused variable ‘count’ [-Wunused-variable] 198 | long count; | ^~~~~ pypesq/pesqio.c:196:10: warning: unused variable ‘to_read’ [-Wunused-variable] 196 | long to_read; | ^~~~~~~ gcc -pthread -B /root/miniconda3/envs/timbrewatermark/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipypesq -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy -I/root/miniconda3/envs/timbrewatermark/include/python3.8 -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include -c pypesq/pesqmain.c -o build/temp.linux-x86_64-cpython-38/pypesq/pesqmain.o pypesq/pesqmain.c: In function ‘compute_pesq’: pypesq/pesqmain.c:118:10: warning: unused variable ‘names’ [-Wunused-variable] 118 | int names = 0; | ^~~~~ pypesq/pesqmain.c: In function ‘pesq_measure’: pypesq/pesqmain.c:405:25: warning: variable ‘end’ set but not used [-Wunused-but-set-variable] 405 | long start, end; | ^~~ pypesq/pesqmain.c:405:18: warning: variable ‘start’ set but not used [-Wunused-but-set-variable] 405 | long start, end; | ^~~~~ pypesq/pesqmain.c:242:9: warning: unused variable ‘i’ [-Wunused-variable] 242 | int i; | ^ pypesq/pesqmain.c:404:12: warning: ‘resultsFile’ may be used uninitialized [-Wmaybe-uninitialized] 404 | if (resultsFile != NULL) { | ^ gcc -pthread -B /root/miniconda3/envs/timbrewatermark/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipypesq -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include/numpy -I/root/miniconda3/envs/timbrewatermark/include/python3.8 -I/root/miniconda3/envs/timbrewatermark/lib/python3.8/site-packages/numpy/core/include -c pypesq/pesqmod.c -o build/temp.linux-x86_64-cpython-38/pypesq/pesqmod.o pypesq/pesqmod.c: In function ‘utterance_split’: pypesq/pesqmod.c:298:10: warning: variable ‘Utt_Delay’ set but not used [-Wunused-but-set-variable] 298 | long Utt_Delay; | ^~~~~~~~~ pypesq/pesqmod.c: In function ‘pesq_psychoacoustic_model’: pypesq/pesqmod.c:806:13: warning: variable ‘peak’ set but not used [-Wunused-but-set-variable] 806 | float peak; | ^~~~ pypesq/pesqmod.c:782:24: warning: variable ‘power_deg’ set but not used [-Wunused-but-set-variable] 782 | float power_ref, power_deg; | ^~~~~~~~~ pypesq/pesqmod.c:782:13: warning: variable ‘power_ref’ set but not used [-Wunused-but-set-variable] 782 | float power_ref, power_deg; | ^~~~~~~~~ g++ -pthread -B /root/miniconda3/envs/timbrewatermark/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -pthread -shared -B /root/miniconda3/envs/timbrewatermark/compiler_compat -L/root/miniconda3/envs/timbrewatermark/lib -Wl,-rpath=/root/miniconda3/envs/timbrewatermark/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-cpython-38/pypesq/dsp.o build/temp.linux-x86_64-cpython-38/pypesq/pesq.o build/temp.linux-x86_64-cpython-38/pypesq/pesqdsp.o build/temp.linux-x86_64-cpython-38/pypesq/pesqio.o build/temp.linux-x86_64-cpython-38/pypesq/pesqmain.o build/temp.linux-x86_64-cpython-38/pypesq/pesqmod.o -o build/lib.linux-x86_64-cpython-38/pesq_core.cpython-38-x86_64-linux-gnu.so /root/miniconda3/envs/timbrewatermark/compiler_compat/ld: build/temp.linux-x86_64-cpython-38/pypesq/pesqdsp.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesq.h:143: multiple definition of `Nb'; build/temp.linux-x86_64-cpython-38/pypesq/pesq.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesq.h:143: first defined here /root/miniconda3/envs/timbrewatermark/compiler_compat/ld: build/temp.linux-x86_64-cpython-38/pypesq/pesqio.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesq.h:143: multiple definition of `Nb'; build/temp.linux-x86_64-cpython-38/pypesq/pesq.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesq.h:143: first defined here /root/miniconda3/envs/timbrewatermark/compiler_compat/ld: build/temp.linux-x86_64-cpython-38/pypesq/pesqmain.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesq.h:143: multiple definition of `Nb'; build/temp.linux-x86_64-cpython-38/pypesq/pesq.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesq.h:143: first defined here /root/miniconda3/envs/timbrewatermark/compiler_compat/ld: build/temp.linux-x86_64-cpython-38/pypesq/pesqmod.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesq.h:143: multiple definition of `Nb'; build/temp.linux-x86_64-cpython-38/pypesq/pesq.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesq.h:143: first defined here /root/miniconda3/envs/timbrewatermark/compiler_compat/ld: build/temp.linux-x86_64-cpython-38/pypesq/pesqmod.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesqpar.h:123: multiple definition of `InIIR_Nsos'; build/temp.linux-x86_64-cpython-38/pypesq/pesqdsp.o:/tmp/pip-install-b4hzkb01/pypesq_e9848519956f4b538b2373b159e56aef/pypesq/pesqdsp.c:136: first defined here collect2: error: ld returned 1 exit status error: command '/usr/bin/g++' 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 pypesq Running setup.py clean for pypesq Failed to build pypesq ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pypesq)
最新发布
06-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值