报错内容
# pip install psutil
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting psutil
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/90/c7/6dc0a455d111f68ee43f27793971cf03fe29b6ef972042549db29eec39a2/psutil-5.9.8.tar.gz (503 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: psutil
Building wheel for psutil (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for psutil (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [50 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-39
creating build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_pswindows.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_pssunos.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_psposix.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_psosx.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_pslinux.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_psbsd.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_psaix.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_compat.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/_common.py -> build/lib.linux-aarch64-cpython-39/psutil
copying psutil/__init__.py -> build/lib.linux-aarch64-cpython-39/psutil
creating build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_process_all.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/runner.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/__main__.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-aarch64-cpython-39
creating build/temp.linux-aarch64-cpython-39/psutil
creating build/temp.linux-aarch64-cpython-39/psutil/arch
creating build/temp.linux-aarch64-cpython-39/psutil/arch/linux
gcc -pthread -B /root/anaconda3/envs/sakura/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /root/anaconda3/envs/sakura/include -I/root/anaconda3/envs/sakura/include -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /root/anaconda3/envs/sakura/include -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/root/anaconda3/envs/sakura/include/python3.9 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-39/psutil/_psutil_common.o
gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
gcc: error: unrecognized command-line option ‘-n1’; did you mean ‘-n’?
gcc: error: unrecognized command-line option ‘-n1’; did you mean ‘-n’?
psutil could not be installed from sources. Perhaps Python header files are not installed. Try running:
sudo yum install gcc python3-devel
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 psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects
解决方案
尝试过:
sudo apt install gcc make libc6-dev
sudo apt install python-dev python-pip
或
sudo yum install gcc make glibc-devel
sudo yum install python3-devel python3-pip
都没什么效果
直接暴力安装
sudo pip install psutil -i https://pypi.tuna.tsinghua.edu.cn/simple --force
我是在安装TTS
时出现的这些报错
其中python-crfsuite
使用暴力安装也装不上
最后用conda装上了
conda install -c conda-forge python-crfsuite
在安装TTS
时记得要加--force
pip install TTS --force