pyfakewebcam icon indicating copy to clipboard operation
pyfakewebcam copied to clipboard

I keep getting this error, whether from source

Open Em-Lopez opened this issue 6 years ago • 6 comments

File "build/bdist.linux-x86_64/egg/pyfakewebcam/init.py", line 3, in
File "build/bdist.linux-x86_64/egg/pyfakewebcam/pyfakewebcam.py", line 8, in ImportError: No module named v4l2

Em-Lopez avatar Oct 28 '18 11:10 Em-Lopez

So I cd'd into the directory and it lets me import v4l2 as _v4l2 without any issues, but import pyfakewebcam.v4l2 as _v4l2 is like a sin and evil. Why won't this work.

Em-Lopez avatar Oct 29 '18 01:10 Em-Lopez

Ok I solved it in pyfakewebcam.py import pyfakewebcam.v4l2 as _v4l2 -> from pyfakewebcam import v4l2 as _v4l2

Em-Lopez avatar Oct 29 '18 01:10 Em-Lopez

I'll try to take a look into the issue you guys are having this weekend. I'll push out updates if necessary!

jremmons avatar Nov 01 '18 03:11 jremmons

An import problem still appears:

>>> import pyfakewebcam
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyfakewebcam/__init__.py", line 3, in <module>
    from pyfakewebcam.pyfakewebcam import FakeWebcam
  File "pyfakewebcam/pyfakewebcam.py", line 8, in <module>
    import pyfakewebcam.v4l2 as _v4l2
ImportError: No module named v4l2

Can you offer a quick fix? Got confused with the name masking of the modules pyfakewebcam and v4l2

serbuh avatar Jan 04 '20 22:01 serbuh

This happens with python2. @serbuh To solve that, import this at the beginning of the __init__.py and pyfakewebcam.py:

from __future__ import absolute_import

charlielito avatar Jun 22 '20 17:06 charlielito

I solved copy pyfakewebcam.py and v4l2.py to my program directory.And change import pyfakewebcam.v4l2 as _v4l2 -> import v4l2 as _v4l2 in pyfakewebcam.py

hoshianaaa avatar Mar 25 '21 04:03 hoshianaaa