Python3.6在Win10环境下,使用如下命令安装pyav:
pip install av
出现如下报错,导致装不上pyav:
????????ERROR: Failed building wheel for av ????????Failed to build av ????????ERROR: Could not build wheels for av which use PEP 517 and cannot be installed directly:
(C:\Users\Jayce\Anaconda3\envs\tf1.7) E:\Code\Python>pip install av
Looking in indexes: https://pypi.doubanio.com/simple
Collecting av
Downloading https://pypi.doubanio.com/packages/00/3f/9fe21065912902a7856a69df334a67b73a51da5e08ff033fd79f15d05764/av-9.1.1.tar.gz (2.4 MB)
|████████████████████████████████| 2.4 MB 3.2 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: av
Building wheel for av (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Jayce\Anaconda3\envs\tf1.7\python.exe' 'C:\Users\Jayce\Anaconda3\envs\tf1.7\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\J
ayce\AppData\Local\Temp\tmpctqsnqx6'
cwd: C:\Users\Jayce\AppData\Local\Temp\pip-install-hi4s2fdw\av_03c9287622cf4da7918135c5be424e7b
Complete output (38 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\av
copying av\about.py -> build\lib.win-amd64-3.6\av
copying av\datasets.py -> build\lib.win-amd64-3.6\av
copying av\deprecation.py -> build\lib.win-amd64-3.6\av
copying av\__init__.py -> build\lib.win-amd64-3.6\av
copying av\__main__.py -> build\lib.win-amd64-3.6\av
creating build\lib.win-amd64-3.6\av\audio
copying av\audio\__init__.py -> build\lib.win-amd64-3.6\av\audio
creating build\lib.win-amd64-3.6\av\codec
copying av\codec\__init__.py -> build\lib.win-amd64-3.6\av\codec
creating build\lib.win-amd64-3.6\av\container
copying av\container\__init__.py -> build\lib.win-amd64-3.6\av\container
creating build\lib.win-amd64-3.6\av\data
copying av\data\__init__.py -> build\lib.win-amd64-3.6\av\data
creating build\lib.win-amd64-3.6\av\filter
copying av\filter\__init__.py -> build\lib.win-amd64-3.6\av\filter
creating build\lib.win-amd64-3.6\av\sidedata
copying av\sidedata\__init__.py -> build\lib.win-amd64-3.6\av\sidedata
creating build\lib.win-amd64-3.6\av\subtitles
copying av\subtitles\__init__.py -> build\lib.win-amd64-3.6\av\subtitles
creating build\lib.win-amd64-3.6\av\video
copying av\video\__init__.py -> build\lib.win-amd64-3.6\av\video
running build_ext
building 'av.buffer' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\src
creating build\temp.win-amd64-3.6\Release\src\av
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c logo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Jayce\Anaconda3\envs\tf1.7\include -IC:\Users\Jayce\Anaconda
3\envs\tf1.7\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Wi
ndows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcsrc\av\buffer.c /Fobuild\temp.win-amd6
4-3.6\Release\src\av\buffer.obj
buffer.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe logo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\Jayce\Anaconda3
\envs\tf1.7\libs /LIBPATH:C:\Users\Jayce\Anaconda3\envs\tf1.7\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\
Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" avformat.lib avcodec.lib avdevice.lib avutil.lib avfilter.lib swscale.li
b swresample.lib /EXPORT:PyInit_buffer build\temp.win-amd64-3.6\Release\src\av\buffer.obj /OUT:build\lib.win-amd64-3.6\av\buffer.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Rele
ase\src\av\buffer.cp36-win_amd64.lib
LINK : fatal error LNK1181: cannot open input file 'avformat.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1181
----------------------------------------
ERROR: Failed building wheel for av
Failed to build av
ERROR: Could not build wheels for av which use PEP 517 and cannot be installed directly
????????这是因为不带版本号安装会安装最新版本的pyav,而最新版本的pyav没有适合python3.6的版本,因此需要自己编译,而自己编译需要安装FFmpeg,进而导致因为没有FFmpeg引发了编译错误。
????????1.要么就是自己装FFmpeg,然后编译;
????????2.要么就直接去找适合python3.6的whl文件,直接安装;
????????我这边直接在镜像网站查到最新的支持python3.6的pyav为8.0.3,下载安装:
或者在pip命令加上适合python3.6的具体版本号:
pip install av==8.0.3
|