install thumbnails on ubuntu 23.10
Closed this issue · 18 comments
Bug description
Hi
I try to install and use your code in ubuntu using this code:
pipx install thumbnails
but it shows the following error:
IP STDOUT
----------
Collecting thumbnails
Using cached thumbnails-0.1.11-py3-none-any.whl.metadata (6.1 kB)
Collecting click>=8.0.3 (from thumbnails)
Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting imageio-ffmpeg>=0.4.7 (from thumbnails)
Using cached imageio_ffmpeg-0.4.9-py3-none-manylinux2010_x86_64.whl.metadata (1.7 kB)
Collecting imageio>=2.23.0 (from thumbnails)
Using cached imageio-2.34.0-py3-none-any.whl.metadata (4.9 kB)
Collecting pillow>=8.4.0 (from thumbnails)
Using cached pillow-10.2.0-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (9.7 kB)
Collecting rich>=13.0.0 (from thumbnails)
Using cached rich-13.7.1-py3-none-any.whl.metadata (18 kB)
Collecting av==9.2.0 (from thumbnails)
Using cached av-9.2.0.tar.gz (2.4 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
PIP STDERR
----------
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [11 lines of output]
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libavformat', required by 'virtual:world', not found
Package 'libavcodec', required by 'virtual:world', not found
Package 'libavdevice', required by 'virtual:world', not found
Package 'libavutil', required by 'virtual:world', not found
Package 'libavfilter', required by 'virtual:world', not found
Package 'libswscale', required by 'virtual:world', not found
Package 'libswresample', required by 'virtual:world', not found
pkg-config could not find libraries ['avformat', 'avcodec', 'avdevice', 'avutil', 'avfilter', 'swscale', 'swresample']
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
How can I install it?
Regards
Reproduction URL
No response
Reproduction steps
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Screenshots
Logs
No response
Browsers
No response
OS
Ubuntu 23.10
Hi @mahdiar, the error you're getting is very natural. The ffmpeg
has those dependencies, so you should install them before installing thumbnails
.
sudo apt-get install libavformat libavcodec libavdevice libavutil libavfilter libswscale libswresample
Hi @mahdiar, the error you're getting is very natural. The
ffmpeg
has those dependencies, so you should install them before installingthumbnails
.sudo apt-get install libavformat libavcodec libavdevice libavutil libavfilter libswscale libswresample
Thanks. I try it and this is the error:
E: Unable to locate package libavformat
E: Unable to locate package libavcodec
E: Unable to locate package libavdevice
E: Unable to locate package libavutil
E: Unable to locate package libavfilter
E: Unable to locate package libswscale
E: Unable to locate package libswresample
These are possibilities for one of them
libavformat60 libavformat-dev libavformat-extra libavformat-extra60
Okay, maybe they are in a custom repository. Try to search "ubuntu install " for each package on the Google. Also, installing the ffmpeg
could automatically handle the installation of its dependencies, so please try sudo apt-get install ffmpeg
.
I have been installed latest ffmpeg and these dependecies:
ffmpeg version 6.0-6ubuntu1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (Ubuntu 13.2.0-2ubuntu1)
configuration: --prefix=/usr --extra-version=6ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
Does pipx install ...
still fail?
Yes same error.
Is it because of the package name?
for example there is "libavformat60" package but not "libavformat" in ubuntu repos.
Try sudo apt-get install libavformat-dev
, I just Googled it, it should solve the libavformat
issue. Please Google the rest yourself and try to install it again.
Thanks. I installed all dev packages:
sudo apt-get install libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libavfilter-dev libswscale-dev libswresample-dev
Now pipx error is different:
pip seemed to fail to build package:
av==9.2.0
Some possibly relevant errors from pip install:
error: subprocess-exited-with-error
Cython.Compiler.Errors.CompileError: av/logging.pyx
Error installing thumbnails.
And this the full log:
PIP STDOUT
----------
Collecting thumbnails
Using cached thumbnails-0.1.11-py3-none-any.whl.metadata (6.1 kB)
Collecting click>=8.0.3 (from thumbnails)
Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting imageio-ffmpeg>=0.4.7 (from thumbnails)
Using cached imageio_ffmpeg-0.4.9-py3-none-manylinux2010_x86_64.whl.metadata (1.7 kB)
Collecting imageio>=2.23.0 (from thumbnails)
Using cached imageio-2.34.0-py3-none-any.whl.metadata (4.9 kB)
Collecting pillow>=8.4.0 (from thumbnails)
Using cached pillow-10.2.0-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (9.7 kB)
Collecting rich>=13.0.0 (from thumbnails)
Using cached rich-13.7.1-py3-none-any.whl.metadata (18 kB)
Collecting av==9.2.0 (from thumbnails)
Using cached av-9.2.0.tar.gz (2.4 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
PIP STDERR
----------
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [86 lines of output]
Compiling av/packet.pyx because it changed.
[1/1] Cythonizing av/packet.pyx
Compiling av/enum.pyx because it changed.
[1/1] Cythonizing av/enum.pyx
Compiling av/dictionary.pyx because it changed.
[1/1] Cythonizing av/dictionary.pyx
Compiling av/buffer.pyx because it changed.
[1/1] Cythonizing av/buffer.pyx
Compiling av/_core.pyx because it changed.
[1/1] Cythonizing av/_core.pyx
Compiling av/option.pyx because it changed.
[1/1] Cythonizing av/option.pyx
Compiling av/stream.pyx because it changed.
[1/1] Cythonizing av/stream.pyx
Compiling av/utils.pyx because it changed.
[1/1] Cythonizing av/utils.pyx
Compiling av/error.pyx because it changed.
[1/1] Cythonizing av/error.pyx
Compiling av/plane.pyx because it changed.
[1/1] Cythonizing av/plane.pyx
Compiling av/descriptor.pyx because it changed.
[1/1] Cythonizing av/descriptor.pyx
Compiling av/format.pyx because it changed.
[1/1] Cythonizing av/format.pyx
Compiling av/bytesource.pyx because it changed.
[1/1] Cythonizing av/bytesource.pyx
Compiling av/frame.pyx because it changed.
[1/1] Cythonizing av/frame.pyx
performance hint: av/logging.pyx:232:5: Exception check on 'log_callback' will always require the GIL to be acquired.
Possible solutions:
1. Declare 'log_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on 'log_callback' to allow an error code to be returned.
Error compiling Cython file:
------------------------------------------------------------
...
cdef const char *log_context_name(void *ptr) nogil:
cdef log_context *obj = <log_context*>ptr
return obj.name
cdef lib.AVClass log_class
log_class.item_name = log_context_name
^
------------------------------------------------------------
av/logging.pyx:216:22: Cannot assign type 'const char *(void *) except? NULL nogil' to 'const char *(*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'const char *(void *) except? NULL nogil'.
Error compiling Cython file:
------------------------------------------------------------
...
# Start the magic!
# We allow the user to fully disable the logging system as it will not play
# nicely with subinterpreters due to FFmpeg-created threads.
if os.environ.get('PYAV_LOGGING') != 'off':
lib.av_log_set_callback(log_callback)
^
------------------------------------------------------------
av/logging.pyx:351:28: Cannot assign type 'void (void *, int, const char *, va_list) except * nogil' to 'av_log_callback'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, const char *, va_list) except * nogil'.
Compiling av/logging.pyx because it changed.
[1/1] Cythonizing av/logging.pyx
Traceback (most recent call last):
File "/home/mahdiar/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/mahdiar/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mahdiar/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-s594i9hv/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-s594i9hv/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-s594i9hv/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-s594i9hv/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 157, in <module>
File "/tmp/pip-build-env-s594i9hv/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
cythonize_one(*args)
File "/tmp/pip-build-env-s594i9hv/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: av/logging.pyx
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Can you please show me the output of the following command?
pip freeze | grep av
Sure
pip freeze | grep av
DEPRECATION: Loading egg at /usr/local/lib/python3.11/dist-packages/sounddevice-0.4.6-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
pipx freeze | grep av
usage: pipx [-h] [--version]
{install,uninject,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,environment,completions}
...
pipx: error: argument command: invalid choice: 'freeze' (choose from 'install', 'uninject', 'inject', 'upgrade', 'upgrade-all', 'uninstall', 'uninstall-all', 'reinstall', 'reinstall-all', 'list', 'run', 'runpip', 'ensurepath', 'environment', 'completions')
Okay, just try this: pipx install av==9.2.0
if it still fails, please try to install with the original pip
, I am not sure about the package manager you're using i.e. pipx
.
~$ pipx install av==9.2.0
'av' already seems to be installed. Not modifying existing installation in '/home/---/.local/pipx/venvs/av'. Pass '--force' to force installation.
~$ pipx install av==9.2.0 --force
Installing to existing venv 'av'
Fatal error from pip prevented installation. Full pip output in file:
/home/---/.local/pipx/logs/cmd_2024-03-02_23.44.06_pip_errors.log
pip seemed to fail to build package:
av==9.2.0
Some possibly relevant errors from pip install:
error: subprocess-exited-with-error
Cython.Compiler.Errors.CompileError: av/logging.pyx
⚠️ Not removing existing venv /home/---/.local/pipx/venvs/av because it was not created in this session
Error installing av from spec 'av==9.2.0'.
I can't use pip at all in ubuntu. this is the error:
~$ pip install thumbnails
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Okay, it recommends you to install the package with apt install python3-thumbnails
but if it also fails, please upgrade the av
package and try again.
P.S. What was the last error when you tried to install thumbnails
using pipx
?
There isn't in repo:
E: Unable to locate package python3-thumbnails
last error:
Some possibly relevant errors from pip install:
ERROR: Could not find a version that satisfies the requirement tumbnails (from versions: none)
ERROR: No matching distribution found for tumbnails
Error installing tumbnails.
Sorry I should go now but I will check your answer soon. Thanks a lot 🌺
Okay, I have to look at this tomorrow. Sorry, just it's 12:30AM on Armenia :) I'll fix this and let you know. Be patient and have a nice day!
Hey @mahdiar, I am glad to inform you that the issue has gone. You can upgrade the package and be able to use.
pipx upgrade thumbnails
Yes! Thanks a lot
Now I can try it :)