jremmons / pyfakewebcam

A library for writing RGB frames to a fake webcam device on Linux!
GNU Lesser General Public License v3.0
9 stars 2 forks source link

I keep getting this error, whether from source #3

Open Em-Lopez opened 6 years ago

Em-Lopez commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

jremmons commented 6 years ago

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

serbuh commented 4 years ago

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

charlielito commented 4 years ago

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
hoshianaaa commented 3 years ago

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