mac 安装webrtcvad出现了gcc的问题
mac 安装webrtcvad出现了gcc的问题
今天使用下面的命令安装webrtcvad的时候出现了下面的问题,命令为:
pip install webrtcvad
错误信息为:
(base) ➜ ~ pip install webrtcvadLooking in indexes: webrtcvad Downloading (66kB) |████████████████████████████████| 71kB 696kB/sBuilding wheels for collected packages: webrtcvad Building wheel for webrtcvad (setup.py) ... error ERROR: Complete output from command /Users/admin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/5h/mjbc_z1n7m91q21xw9_m217m0000gn/T/pip-install-hy22jowz/webrtcvad/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/5h/mjbc_z1n7m91q21xw9_m217m0000gn/T/pip-wheel-5v9raxcm --python-tag cp37: ERROR: running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.7 copying webrtcvad.py -> build/lib.macosx-10.7-x86_64-3.7 running build_ext building '_webrtcvad' extension creating build/temp.macosx-10.7-x86_64-3.7 creating build/temp.macosx-10.7-x86_64-3.7/cbits creating build/temp.macosx-10.7-x86_64-3.7/cbits/webrtc creating build/temp.macosx-10.7-x86_64-3.7/cbits/webrtc/common_audio creating build/temp.macosx-10.7-x86_64-3.7/cbits/webrtc/common_audio/signal_processing creating build/temp.macosx-10.7-x86_64-3.7/cbits/webrtc/common_audio/vad /usr/local/Cellar/gcc/9.2.0/bin/gcc-9 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/admin/anaconda3/include -arch x86_64 -I/Users/admin/anaconda3/include -arch x86_64 -DWEBRTC_POSIX -Icbits -I/Users/admin/anaconda3/include/python3.7m -c cbits/pywebrtcvad.c -o build/temp.macosx-10.7-x86_64-3.7/cbits/pywebrtcvad.o unable to execute '/usr/local/Cellar/gcc/9.2.0/bin/gcc-9': No such file or directory error: command '/usr/local/Cellar/gcc/9.2.0/bin/gcc-9' failed with exit status 1 ---------------------------------------- ERROR: Failed building wheel for webrtcvad Running setup.py clean for webrtcvadFailed to build webrtcvadInstalling collected packages: webrtcvad Running setup.py install for webrtcvad ... error ERROR: Complete output from command /Users/admin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/5h/mjbc_z1n7m91q21xw9_m217m0000gn/T/pip-install-hy22jowz/webrtcvad/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/5h/mjbc_z1n7m91q21xw9_m217m0000gn/T/pip-record-m4llx73p/install-record.txt --single-version-externally-managed --compile: ERROR: running install running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.7 copying webrtcvad.py -> build/lib.macosx-10.7-x86_64-3.7 running build_ext building '_webrtcvad' extension creating build/temp.macosx-10.7-x86_64-3.7 creating build/temp.macosx-10.7-x86_64-3.7/cbits creating build/temp.macosx-10.7-x86_64-3.7/cbits/webrtc creating build/temp.macosx-10.7-x86_64-3.7/cbits/webrtc/common_audio creating build/temp.macosx-10.7-x86_64-3.7/cbits/webrtc/common_audio/signal_processing creating build/temp.macosx-10.7-x86_64-3.7/cbits/webrtc/common_audio/vad /usr/local/Cellar/gcc/9.2.0/bin/gcc-9 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/admin/anaconda3/include -arch x86_64 -I/Users/admin/anaconda3/include -arch x86_64 -DWEBRTC_POSIX -Icbits -I/Users/admin/anaconda3/include/python3.7m -c cbits/pywebrtcvad.c -o build/temp.macosx-10.7-x86_64-3.7/cbits/pywebrtcvad.o unable to execute '/usr/local/Cellar/gcc/9.2.0/bin/gcc-9': No such file or directory error: command '/usr/local/Cellar/gcc/9.2.0/bin/gcc-9' failed with exit status 1 ----------------------------------------ERROR: Command "/Users/admin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/5h/mjbc_z1n7m91q21xw9_m217m0000gn/T/pip-install-hy22jowz/webrtcvad/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/5h/mjbc_z1n7m91q21xw9_m217m0000gn/T/pip-record-m4llx73p/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/5h/mjbc_z1n7m91q21xw9_m217m0000gn/T/pip-install-hy22jowz/webrtcvad/
解决方法
发现是gcc出现问题了,于是重新安装gcc
brew search gccbrew install gcc
装了之后我发现是gcc9.2,于是加入环境变量:
sudo vim ~/.zshrc
用户可能是bashrc,我这里由于装了zsh,环境变量文件变成了zshrc,用户可以自己打开自己的bashrc。
alias gcc='gcc-9'alias cc='gcc-9'alias g++='g++-9'alias c++='c++-9'
然后命令行输入:
source ~/.zshrc
然后就可以重新安装了:
(base) ➜ ~ pip install webrtcvadLooking in indexes: webrtcvad Downloading (66kB) |████████████████████████████████| 71kB 642kB/s Building wheels for collected packages: webrtcvad Building wheel for webrtcvad (setup.py) ... done Stored in directory: /Users/admin/Library/Caches/pip/wheels/f5/90/4c/296ccd2e89848899bd357d5e596d88f7b9bf180f3ec8c5b326Successfully built webrtcvadInstalling collected packages: webrtcvadSuccessfully installed webrtcvad-2.0.10
参考文献
[1].Mac OS升级GCC版本. https://wangxin1248.github.io/life/2019/06/mac-update-gcc.html
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~