AlfredoSequeida / fvid

fvid is a project that aims to encode any file as a video using 1-bit color images to survive compression algorithms for data retrieval.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No module named 'magic'

minhngoc25a opened this issue · comments

I've just started to use fvid again, but:

E:\>fvid -i Documents.rar -e -o Documents.mp4
Traceback (most recent call last):
  File "c:\users\tran bich dung\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\tran bich dung\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Tran Bich Dung\AppData\Local\Programs\Python\Python39\Scripts\fvid.exe\__main__.py", line 4, in <module>
  File "c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages\fvid\fvid.py", line 16, in <module>
    import magic
ModuleNotFoundError: No module named 'magic'

I don't know what happened. I tried to install 'magic':

E:\>py -m pip install magic
ERROR: Could not find a version that satisfies the requirement magic
ERROR: No matching distribution found for magic

And upgrade fvid to the latest master branch:

E:\>py -m pip install --upgrade git+https://github.com/AlfredoSequeida/fvid
Collecting git+https://github.com/AlfredoSequeida/fvid
  Cloning https://github.com/AlfredoSequeida/fvid to c:\users\tran bich dung\appdata\local\temp\pip-req-build-zyhpx15q
  Running command git clone -q https://github.com/AlfredoSequeida/fvid 'C:\Users\Tran Bich Dung\AppData\Local\Temp\pip-req-build-zyhpx15q'
Requirement already satisfied: bitstring>=3.1.6 in c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages (from fvid==1.0.0) (3.1.7)
Requirement already satisfied: pillow>=7.2.0 in c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages (from fvid==1.0.0) (8.0.1)
Requirement already satisfied: tqdm>=4.49.0 in c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages (from fvid==1.0.0) (4.54.1)
Requirement already satisfied: cryptography>=3.1.1 in c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages (from fvid==1.0.0) (3.2.1)
Requirement already satisfied: pycryptodome>=3.9.8 in c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages (from fvid==1.0.0) (3.9.9)
Requirement already satisfied: six>=1.4.1 in c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages (from cryptography>=3.1.1->fvid==1.0.0) (1.15.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages (from cryptography>=3.1.1->fvid==1.0.0) (1.14.4)
Requirement already satisfied: pycparser in c:\users\tran bich dung\appdata\local\programs\python\python39\lib\site-packages (from cffi!=1.11.3,>=1.8->cryptography>=3.1.1->fvid==1.0.0) (2.20)
Building wheels for collected packages: fvid
  Building wheel for fvid (setup.py) ... done
  Created wheel for fvid: filename=fvid-1.0.0-py3-none-any.whl size=9930 sha256=23a8357e046bb26ea95a09bc2dd433ab5a1e4872a064e09f19ed726fba392229
  Stored in directory: C:\Users\Tran Bich Dung\AppData\Local\Temp\pip-ephem-wheel-cache-xf5q5eny\wheels\7d\29\2f\3abea42ac756b48077987d878a53a93f6ec3b1cee1c8560187
Successfully built fvid
Installing collected packages: fvid
  Attempting uninstall: fvid
    Found existing installation: fvid 1.0.1
    Uninstalling fvid-1.0.1:
      Successfully uninstalled fvid-1.0.1
Successfully installed fvid-1.0.0

But it still doesn't work...
Any help appreciated. Thanks!

Can you try installing from git now? I updated the requirements to require python-magic.

@AlfredoSequeida If this works, can you release 1.0.1 as a bugfix for this?

Edit: Don't include the tests folder in the PyPi package if you release it.

Updating fvid from source takes longer time than updating youtube-dl from source. You should clean out that test folder.

Anyway, installing python-magic and zfec requires Microsoft Visual C++ 14.0, fvid should've included those out-of-the-box.

fvid just doesn't work. I installed Visual studio build tools and it doesn't work... I can't install zfec, though I can install python-magic

G:\>py -m pip install zfec
Collecting zfec
  Using cached zfec-1.5.5.tar.gz (80 kB)
Collecting argparse>=0.8
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Building wheels for collected packages: zfec
  Building wheel for zfec (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Tran Bich Dung\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Tran Bich Dung\\AppData\\Local\\Temp\\pip-install-g5cr3isf\\zfec_42e6e8daccff4a529cd090136f4fa8f1\\setup.py'"'"'; __file__='"'"'C:\\Users\\Tran Bich Dung\\AppData\\Local\\Temp\\pip-install-g5cr3isf\\zfec_42e6e8daccff4a529cd090136f4fa8f1\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Tran Bich Dung\AppData\Local\Temp\pip-wheel-vuaajxo9'
       cwd: C:\Users\Tran Bich Dung\AppData\Local\Temp\pip-install-g5cr3isf\zfec_42e6e8daccff4a529cd090136f4fa8f1\
  Complete output (35 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.9
  creating build\lib.win32-3.9\zfec
  copying zfec\cmdline_zfec.py -> build\lib.win32-3.9\zfec
  copying zfec\cmdline_zunfec.py -> build\lib.win32-3.9\zfec
  copying zfec\easyfec.py -> build\lib.win32-3.9\zfec
  copying zfec\filefec.py -> build\lib.win32-3.9\zfec
  copying zfec\_version.py -> build\lib.win32-3.9\zfec
  copying zfec\__init__.py -> build\lib.win32-3.9\zfec
  creating build\lib.win32-3.9\zfec\test
  copying zfec\test\test_zfec.py -> build\lib.win32-3.9\zfec\test
  copying zfec\test\__init__.py -> build\lib.win32-3.9\zfec\test
  running egg_info
  writing zfec.egg-info\PKG-INFO
  writing dependency_links to zfec.egg-info\dependency_links.txt
  writing entry points to zfec.egg-info\entry_points.txt
  writing requirements to zfec.egg-info\requires.txt
  writing top-level names to zfec.egg-info\top_level.txt
  reading manifest file 'zfec.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*~' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  writing manifest file 'zfec.egg-info\SOURCES.txt'
  copying zfec\_fecmodule.c -> build\lib.win32-3.9\zfec
  copying zfec\fec.c -> build\lib.win32-3.9\zfec
  copying zfec\fec.h -> build\lib.win32-3.9\zfec
  UPDATING build\lib.win32-3.9\zfec/_version.py
  set build\lib.win32-3.9\zfec/_version.py to '1.5.5'
  running build_ext
  building 'zfec._fec' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
  ----------------------------------------
  ERROR: Failed building wheel for zfec
  Running setup.py clean for zfec
Failed to build zfec
Installing collected packages: argparse, zfec
    Running setup.py install for zfec ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Tran Bich Dung\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Tran Bich Dung\\AppData\\Local\\Temp\\pip-install-g5cr3isf\\zfec_42e6e8daccff4a529cd090136f4fa8f1\\setup.py'"'"'; __file__='"'"'C:\\Users\\Tran Bich Dung\\AppData\\Local\\Temp\\pip-install-g5cr3isf\\zfec_42e6e8daccff4a529cd090136f4fa8f1\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Tran Bich Dung\AppData\Local\Temp\pip-record-qx353vu6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Tran Bich Dung\AppData\Local\Programs\Python\Python39\Include\zfec'
         cwd: C:\Users\Tran Bich Dung\AppData\Local\Temp\pip-install-g5cr3isf\zfec_42e6e8daccff4a529cd090136f4fa8f1\
    Complete output (35 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.9
    creating build\lib.win32-3.9\zfec
    copying zfec\cmdline_zfec.py -> build\lib.win32-3.9\zfec
    copying zfec\cmdline_zunfec.py -> build\lib.win32-3.9\zfec
    copying zfec\easyfec.py -> build\lib.win32-3.9\zfec
    copying zfec\filefec.py -> build\lib.win32-3.9\zfec
    copying zfec\_version.py -> build\lib.win32-3.9\zfec
    copying zfec\__init__.py -> build\lib.win32-3.9\zfec
    creating build\lib.win32-3.9\zfec\test
    copying zfec\test\test_zfec.py -> build\lib.win32-3.9\zfec\test
    copying zfec\test\__init__.py -> build\lib.win32-3.9\zfec\test
    running egg_info
    writing zfec.egg-info\PKG-INFO
    writing dependency_links to zfec.egg-info\dependency_links.txt
    writing entry points to zfec.egg-info\entry_points.txt
    writing requirements to zfec.egg-info\requires.txt
    writing top-level names to zfec.egg-info\top_level.txt
    reading manifest file 'zfec.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*~' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    writing manifest file 'zfec.egg-info\SOURCES.txt'
    copying zfec\_fecmodule.c -> build\lib.win32-3.9\zfec
    copying zfec\fec.c -> build\lib.win32-3.9\zfec
    copying zfec\fec.h -> build\lib.win32-3.9\zfec
    UPDATING build\lib.win32-3.9\zfec/_version.py
    set build\lib.win32-3.9\zfec/_version.py to '1.5.5'
    running build_ext
    building 'zfec._fec' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Tran Bich Dung\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Tran Bich Dung\\AppData\\Local\\Temp\\pip-install-g5cr3isf\\zfec_42e6e8daccff4a529cd090136f4fa8f1\\setup.py'"'"'; __file__='"'"'C:\\Users\\Tran Bich Dung\\AppData\\Local\\Temp\\pip-install-g5cr3isf\\zfec_42e6e8daccff4a529cd090136f4fa8f1\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Tran Bich Dung\AppData\Local\Temp\pip-record-qx353vu6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Tran Bich Dung\AppData\Local\Programs\Python\Python39\Include\zfec' Check the logs for full command output.

EDIT: This is the output from 'Developer Command Prompt for VS 2019'

Anyway, installing python-magic and zfec requires Microsoft Visual C++ 14.0, fvid should've included those out-of-the-box.

Are you sure you installed Microsoft Visual C++ 14.0, because I installed it on my backup windows computer with Microsoft Visual C++ 14 and it worked fine. Also, how would fvid include those out-of-the-box? That's an appealing option, but I don't know how to do that.

I got it going. I downloaded a precompiled zfec and installed it. Apparently, on Windows, you have to install python-magic-bin to fetch libmagic's DLL.