You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error with pip install av "pkg-config returned flags we don't understand: -pthread -pthread" #510
Trying to install PyAV in a virtualenv with FFMPEG built from source.
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" pip install av fails with:
running config
pkg-config returned flags we don't understand: -pthread -pthread
----------------------------------------
ERROR: Failed building wheel for av
Running setup.py clean for av
FFMPEG 4.1.3 was built from source according to the usual FFMPEG build instructions. Specific configure and build command was:
changed the title [-]Error with `pip install av` "pkg-config returned flags we don't understand: -pthread -pthread[/-][+]Error with `pip install av` "pkg-config returned flags we don't understand: -pthread -pthread"[/+]on Apr 26, 2019
Modifying PyAV's setup.py to support -pthread is fairly trivial.
However, after many attempts I have been unable to successfully link against statically compiled ffmpeg libraries. AFAICT ffmpeg has multiple symbols which would need a visibility attribute for a static ffmpeg build to be usable in a shared library such as a Python module.
That being the case I'm not sure it's worth modifying setup.py..
I'll make my periodic ask: anyone know how to detect that it will link against a static library and stop it? So many GitHub issues would be resolved if the build system would just say "We can't link to static FFmpeg."
I have a similar error also when trying to install onto Raspbian Jesse. I too had compiled ffmpeg from source. Any suggestions?
I was successful in compiling PyAV from source, but it is not recognized by python as a module. That is, "import av" fails with "No module named 'av._core'".
The suggestion is: don't create a static ffmpeg build. Also if you use Raspbian Stretch, you should already have a pre-compiled PyAV, courtesy of piwheels: https://www.piwheels.org/project/av/
I'm trying to compile PyAv in order to use the hwaccel branch, and I'm having trouble. I started with a clean VM and didn't compile anything myself besides running scripts/build-deps. It compiled succesfuly but now I'm getting No module named 'av._core'. Any ideas what went wrong?
Edit: nevermind, I didn't have pkg-config. Installed then, then ran make again, and I'm up and running.
I've experienced this error trying to use the av package with an ffmpeg build configured to use h264_cuvid as a hardware decoder. It is not a static build.
@Fruchtzwerg94 -- did you have to add -fPIC to cflags when building the ffmpeg that PyAV is linking to? I'm getting a linker error and I don't want to be running down a rathole. (Trying it though!)
@Fruchtzwerg94 -- did you have to add -fPIC to cflags when building the ffmpeg that PyAV is linking to? I'm getting a linker error and I don't want to be running down a rathole. (Trying it though!)
I'm getting these errors. I tried -fPIC, too, and still got it. I need to check to see if they really were compiled right.
/bin/ld: /usr/local/lib/libavdevice.a(fbdev_common.o): relocation R_X86_64_32 against `.rodata' can not be used when ma
king a shared object; recompile with -fPIC
/bin/ld: /usr/local/lib/libavdevice.a(oss.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when maki
ng a shared object; recompile with -fPIC
/bin/ld: /usr/local/lib/libavdevice.a(v4l2-common.o): relocation R_X86_64_32 against symbol `ff_fmt_conversion_table' c
an not be used when making a shared object; recompile with -fPIC
Yes, I had to take a private copy and comment out the line in the setup.py that calls exit(0) if it sees this flag. I also had to add the flag --enable-shared (and -fPIC) to a private build of ffmpeg 4.1.x
Activity
[-]Error with `pip install av` "pkg-config returned flags we don't understand: -pthread -pthread[/-][+]Error with `pip install av` "pkg-config returned flags we don't understand: -pthread -pthread"[/+]jlaine commentedon May 2, 2019
Static builds are currently not supported by PyAV's build system.
jlaine commentedon May 5, 2019
Modifying PyAV's setup.py to support
-pthreadis fairly trivial.However, after many attempts I have been unable to successfully link against statically compiled ffmpeg libraries. AFAICT ffmpeg has multiple symbols which would need a
visibilityattribute for a static ffmpeg build to be usable in a shared library such as a Python module.That being the case I'm not sure it's worth modifying setup.py..
mikeboers commentedon May 7, 2019
I'll make my periodic ask: anyone know how to detect that it will link against a static library and stop it? So many GitHub issues would be resolved if the build system would just say "We can't link to static FFmpeg."
gregory-whaley commentedon May 18, 2019
I have a similar error also when trying to install onto Raspbian Jesse. I too had compiled ffmpeg from source. Any suggestions?
I was successful in compiling PyAV from source, but it is not recognized by python as a module. That is, "import av" fails with "No module named 'av._core'".
jlaine commentedon Jun 3, 2019
The suggestion is: don't create a static ffmpeg build. Also if you use Raspbian Stretch, you should already have a pre-compiled PyAV, courtesy of piwheels: https://www.piwheels.org/project/av/
hsharrison commentedon Jul 12, 2019
I'm trying to compile PyAv in order to use the hwaccel branch, and I'm having trouble. I started with a clean VM and didn't compile anything myself besides running
scripts/build-deps. It compiled succesfuly but now I'm gettingNo module named 'av._core'. Any ideas what went wrong?Edit: nevermind, I didn't have pkg-config. Installed then, then ran make again, and I'm up and running.
ramoncaldeira commentedon Jul 18, 2019
I've experienced this error trying to use the av package with an ffmpeg build configured to use h264_cuvid as a hardware decoder. It is not a static build.
Fruchtzwerg94 commentedon Jul 28, 2019
I hat the same problem. The following solution worked for me:
--enable-shared/usr/local/libtoLD_LIBRARY_PATH)source scripts/activate.shmakePYTHONPATHif you are not installing the packageReuvenSwirsky commentedon Apr 16, 2020
@Fruchtzwerg94 -- did you have to add -fPIC to cflags when building the ffmpeg that PyAV is linking to? I'm getting a linker error and I don't want to be running down a rathole. (Trying it though!)
Fruchtzwerg94 commentedon Apr 17, 2020
No, I didn't specify any other linker flags.
ReuvenSwirsky commentedon Apr 17, 2020
I'm getting these errors. I tried -fPIC, too, and still got it. I need to check to see if they really were compiled right.
jkurdzieko commentedon Apr 21, 2020
I have same errors, too. Did you find solution.
ReuvenSwirsky commentedon Apr 21, 2020
Yes, I had to take a private copy and comment out the line in the setup.py that calls exit(0) if it sees this flag. I also had to add the flag --enable-shared (and -fPIC) to a private build of ffmpeg 4.1.x
jlaine commentedon Apr 26, 2020
As of PyAV 8.0.0, binary wheels are provided which will greatly simplify installation and should solve your issue.