Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python no module even when it's installled #52

Closed
sxiii opened this issue Aug 10, 2020 · 4 comments
Closed

Python no module even when it's installled #52

sxiii opened this issue Aug 10, 2020 · 4 comments

Comments

@sxiii
Copy link

sxiii commented Aug 10, 2020

Running like: sudo python3 fake.py -B ./back.mp4 -W /dev/video0 or just like sudo python3 -u fake.py leads to:

Traceback (most recent call last):   File "fake.py", line 17, in <module>     import requests_unixsocket ModuleNotFoundError: No module named 'requests_unixsocket'

However,

[sw@t490s fakecam]$ python3 -m pip install requests
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: requests in /home/sw/.local/lib/python3.8/site-packages (2.23.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.8/site-packages (from requests) (2020.6.20)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3.8/site-packages (from requests) (1.25.9)
Requirement already satisfied: idna<3,>=2.5 in /usr/lib/python3.8/site-packages (from requests) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/lib/python3.8/site-packages (from requests) (3.0.4)

Can you lead me what to check?

Thanks

@fangfufu
Copy link
Owner

Try pip3 install requests_unixsocket

@sxiii
Copy link
Author

sxiii commented Aug 10, 2020

@fangfufu same - requirements already satisfied.

But I've just tried to recompile v4l2loopback kernel module. Seems I need a reboot & modprobe:

[sw@t490s fakecam]$ python3 -u fake.py 
Cannot set camera property 3 to 1280, used value: 640.0
Cannot set camera property 5 to 30, used value: 10.0
Traceback (most recent call last):
  File "fake.py", line 379, in <module>
    main()
  File "fake.py", line 352, in main
    cam = FakeCam(
  File "fake.py", line 114, in __init__
    self.fake_cam = pyfakewebcam.FakeWebcam(v4l2loopback_path, self.width, self.height)
  File "/home/sw/.local/lib/python3.8/site-packages/pyfakewebcam/pyfakewebcam.py", line 54, in __init__
    fcntl.ioctl(self._video_device, _v4l2.VIDIOC_S_FMT, self._settings)
OSError: [Errno 22] Invalid argument

@AwesomeKenP
Copy link

@sxiii i had the same issue and what fixed it was specifying the video device path after loading v4l2loopback module:
python3 fake.py --v4l2loopback-path=/dev/videoN, where N was 4 in my case.

@fangfufu
Copy link
Owner

fangfufu commented Jun 8, 2021

This is no longer relevant, as I am using Mediapipe as the backend. Please check out the latest commit.

@fangfufu fangfufu closed this as completed Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants