You are not logged in.

#1 2022-02-28 10:09:30

esko
Member
Registered: 2022-02-28
Posts: 3

[SOLVED] Can't import python arcade library

Importing arcade worked normally before a system upgrade, but after it I get:

python -m venv .env
source .env/bin/activate
python -m pip install arcade
python
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import arcade
Note: Installing the optional Shapely library will improve performance.
      However, Shapely does not run on Python 3.10 for macOS and Windows machines.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jussi/arcade/.env/lib/python3.10/site-packages/arcade/__init__.py", line 237, in <module>
    from .sound import Sound
  File "/home/jussi/arcade/.env/lib/python3.10/site-packages/arcade/sound.py", line 18, in <module>
    import pyglet.media as media
  File "/home/jussi/arcade/.env/lib/python3.10/site-packages/pyglet/media/__init__.py", line 145, in <module>
    add_default_media_codecs()
  File "/home/jussi/arcade/.env/lib/python3.10/site-packages/pyglet/media/codecs/__init__.py", line 102, in add_default_media_codecs
    if have_ffmpeg():
  File "/home/jussi/arcade/.env/lib/python3.10/site-packages/pyglet/media/codecs/__init__.py", line 124, in have_ffmpeg
    from . import ffmpeg_lib
  File "/home/jussi/arcade/.env/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/__init__.py", line 36, in <module>
    from .libavcodec import *
  File "/home/jussi/arcade/.env/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/libavcodec.py", line 46, in <module>
    from . import libavutil
  File "/home/jussi/arcade/.env/lib/python3.10/site-packages/pyglet/media/codecs/ffmpeg_lib/libavutil.py", line 206, in <module>
    avutil.av_frame_get_best_effort_timestamp.restype = c_int64
  File "/usr/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libavutil.so.57: undefined symbol: av_frame_get_best_effort_timestamp
>>>

File '/usr/lib/libavutil.so.57' belongs to 'ffmpeg' package which was upgraded from 2:4.4.1-1 to 2:5.0-4. Current arcade version is 2.6.10. Can anyone give me hints what might be wrong?
Thanks!

Last edited by esko (2022-03-02 09:00:22)

Offline

#2 2022-02-28 10:25:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 16,239

Re: [SOLVED] Can't import python arcade library

Install the ffmpeg4.4 compat package provided for applications that haven't relevantly updated yet.

Offline

#3 2022-02-28 11:53:19

esko
Member
Registered: 2022-02-28
Posts: 3

Re: [SOLVED] Can't import python arcade library

Well, package ffmpeg4.4 is already installed. It was installed at the same time ffmpeg was upgraded.

Offline

#4 2022-03-01 10:45:45

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 10,075

Re: [SOLVED] Can't import python arcade library

Some PKGBUILDs relying on pkgconf to find dependencies / libraries had to be pointed to ffmpeg4.4 by using
export PKG_CONFIG_LIBDIR=/usr/lib/ffmpeg4.4/pkgconfig . Without that statement they used ffmpeg 5 (and failed)

I have no idea how pip / the arcade library search for dependencies, maybe they can be convinced to look in the right place also ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2022-03-02 08:54:42

esko
Member
Registered: 2022-02-28
Posts: 3

Re: [SOLVED] Can't import python arcade library

You are right. I played around with another arch installation and found out that if I remove ffmpeg package then importing works fine.
But because some programs need that package I instead removed directory 'pyglet/media/codecs/ffmpeg_lib' from my project and now it works for a while. So the problem was with pyglet library. Now only .wav files are supported but couldn't find any better solution.

Offline

Board footer

Powered by FluxBB