jashandeep-sohi / webcam-filters

Add filters (background blur, etc) to your webcam on Linux.
GNU General Public License v3.0
551 stars 16 forks source link

Cannot install on Ubuntu 22.04.2 LTS #105

Open zhum opened 1 year ago

zhum commented 1 year ago

Using pip:

$ pip install --user webcam-filters
ERROR: Could not find a version that satisfies the requirement webcam-filters (from versions: none)
ERROR: No matching distribution found for webcam-filters
$ pip -V
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

Using pipx:

$ pipx install --system-site-packages webcam-filters
Fatal error from pip prevented installation. Full pip output in file:
    /home/szhumatiy/.local/pipx/logs/cmd_2023-02-21_11.04.10_pip_errors.log

Some possibly relevant errors from pip install:
    ERROR: Could not find a version that satisfies the requirement webcam-filters (from versions: none)
    ERROR: No matching distribution found for webcam-filters

Error installing webcam-filters.

Via url:

$ url="git+https://github.com/jashandeep-sohi/webcam-filters.git"
$ pipx install --system-site-packages "$url"
Traceback (most recent call last):
  File "/usr/bin/pipx", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/pipx/main.py", line 779, in cli
    return run_pipx_command(parsed_pipx_args)
  File "/usr/lib/python3/dist-packages/pipx/main.py", line 202, in run_pipx_command
    return commands.install(
  File "/usr/lib/python3/dist-packages/pipx/commands/install.py", line 30, in install
    package_name = package_name_from_spec(
  File "/usr/lib/python3/dist-packages/pipx/commands/common.py", line 333, in package_name_from_spec
    package_name = venv.install_package_no_deps(
  File "/usr/lib/python3/dist-packages/pipx/venv.py", line 268, in install_package_no_deps
    old_package_set = self.list_installed_packages()
  File "/usr/lib/python3/dist-packages/pipx/venv.py", line 348, in list_installed_packages
    pip_list = json.loads(cmd_run.stdout.strip())
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
jashandeep-sohi commented 1 year ago

That's very strange. It looks like pip can't find the package on PYPI. It works for me.

Are you able to install other packages from PYPI? Do you see anything when you go here https://pypi.org/project/webcam-filters/

I would try explicitly setting the index url the --index-url https://pypi.python.org/simple, or you can also try installing from Git pip install --user git+https://github.com/jashandeep-sohi/webcam-filters.git@v0.3.0

zhum commented 1 year ago

Thank you! The latest one helped. I had to install additional packages (sudo apt install python3-dev libgirepository1.0-dev; pip install gobject PyGObject, and yes, i have installed python3-gi system package, but...), but now it starts. But I got another trouble, just like in issue #34 , but without any containers. Here is my output:

$ v4l2-ctl --device /dev/video4 --info
Driver Info:
    Driver name      : v4l2 loopback
    Card type        : Virtual Webcam
    Bus info         : platform:v4l2loopback-000
    Driver version   : 5.15.74
    Capabilities     : 0x85200002
        Video Output
        Read/Write
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps      : 0x05200002
        Video Output
        Read/Write
        Streaming
        Extended Pix Format
$ webcam-filters --input-dev /dev/video0 --output-dev /dev/video4 --background-blur 150 
Traceback (most recent call last):
  File "/home/szhumatiy/.local/bin/webcam-filters", line 8, in <module>
    sys.exit(main())
  File "/home/szhumatiy/.local/lib/python3.9/site-packages/webcam_filters/__main__.py", line 5, in main
    cli.main(prog_name="webcam-filters")
  File "/home/szhumatiy/.local/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/szhumatiy/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/szhumatiy/.local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/szhumatiy/.local/lib/python3.9/site-packages/webcam_filters/main.py", line 154, in cli
    add_filters(
  File "/home/szhumatiy/.local/lib/python3.9/site-packages/webcam_filters/gst.py", line 98, in add_filters
    for s in caps:
TypeError: 'Caps' object is not iterable

The same in pass-though mode.

jashandeep-sohi commented 1 year ago

It's really hard to get the system dependencies just right. Even if they are not missing (looks like you have them all), they have to be just the right combination of versions. I'll try to debug this when I get the time, but meanwhile you can try using the Docker or Nix way of installing this.