Mylar3 install issues - unrar-cffi

Post any problems / bugs / issues that are Mylar-related in here.
Post Reply
Welshy
Posts: 2
Joined: Sun Jun 21, 2020 7:14 am

Mylar3 install issues - unrar-cffi

Post by Welshy » Sun Jun 21, 2020 7:28 am

Hey Guys,

Trying to install mylar3 on Ubunutu server 20.04 headless. When try to install the dependencies from the requirements.txt It fails when it gets to installing unrar-cffi==0.1.0a5.

I'm running this command - pip3 install -r requirements.txt within my Mylar3 directory. Log listed below. Running Python 3.8.2. I think it may be an issue with setuptools? I had the original mylar working on the same OS build, using Python 2.7. Now trying to get everything running with python3 on a clean build of 20.04.

Thanks for the help.

Code: Select all

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-svaapp2f/unrar-cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-svaapp2f/unrar-cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-q9vzos2q
         cwd: /tmp/pip-install-svaapp2f/unrar-cffi/
    Complete output (73 lines):
      ERROR: Command errored out with exit status 1:
       command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-t44urv9y/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-t44urv9y/cffi/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 /tmp/pip-wheel-3birmq9i
           cwd: /tmp/pip-wheel-t44urv9y/cffi/
      Complete output (36 lines):
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.8
      creating build/lib.linux-aarch64-3.8/cffi
      copying cffi/api.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/cparser.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/lock.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/__init__.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/verifier.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/error.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/recompiler.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/commontypes.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/model.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/_embedding.h -> build/lib.linux-aarch64-3.8/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-3.8/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-aarch64-3.8
      creating build/temp.linux-aarch64-3.8/c
      aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-aarch64-3.8/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
         15 | #include <ffi.h>
            |          ^~~~~~~
      compilation terminated.
      error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
      ----------------------------------------
      ERROR: Failed building wheel for cffi
    ERROR: Failed to build one or more wheels
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 128, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpwf3typzj', '--quiet', 'cffi']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-svaapp2f/unrar-cffi/setup.py", line 14, in <module>
        setup(
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 143, in setup
        _install_setup_requires(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 138, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 718, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 781, in resolve
        dist = best[req.key] = env.best_match(
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1066, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1078, in obtain
        return installer(requirement)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 777, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 130, in fetch_build_egg
        raise DistutilsError(str(e))
    distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpwf3typzj', '--quiet', 'cffi']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

User avatar
evilhero
Site Admin
Posts: 2532
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Mylar3 install issues - unrar-cffi

Post by evilhero » Mon Jun 22, 2020 8:14 pm

Yeah, we upgraded CT to use a newer code base and in doing so there were a bunch of dependencies that are required because of it. It's really been a PITA to try and work with because it's a 3rd party tool that's made by the author of CT, but it's not being updated to accomodate all the new wheels.

First time I've heard of it not being able to install on a *nix machine tho, which might mean some weird discrepancy with gcc and make possibly (which has occurred before with this).

However you don't need to have it installed for Mylar3 to run. It will work without it, however if you enable MetaTagging within Mylar and then it tries to metatag something, it will throw back an error and it won't be able to perform the tagging. The only portion of Mylar3 that uses the unrar-cffi is in CT.

But short story with a happy ending - I just pushed a Pull Request (#358) up that removes the unrar-cffi and unrar from the requirements.txt file and falls back to using the included rarfile (same as in mylar2) if an existing unrar-cffi is not available. Once that goes live into the python3-dev branch you can update and not have to worry about it any longer (provided you have an unrar binary of course).

Welshy
Posts: 2
Joined: Sun Jun 21, 2020 7:14 am

Re: Mylar3 install issues - unrar-cffi

Post by Welshy » Wed Jul 01, 2020 5:24 am

Awesome, Thanks Evil. I was able to get everything working perfectly.

Post Reply