supermihi / pytaglib

Python audio tagging library
GNU General Public License v3.0
187 stars 29 forks source link

Error installing on linux, python 3.6 - gcc error #74

Closed JamesOwers closed 4 years ago

JamesOwers commented 4 years ago

To reproduce

Set up a python environment and try and install pytaglib on ubuntu 18.04 via pypi, pip installing in the project dir, or trying to use setup.py to build (the error is the same) e.g.

conda create -n pytaglib python=3.6
conda activate pytaglib
pip install pytaglib
git clone https://github.com/supermihi/pytaglib.git 
cd pytaglib
pip install .
python setup.py build

Error

Summary

gcc cannot find taglib/tstring.h so the command #include "taglib/tstring.h" fails

pip install pytaglib

Collecting pytaglib
  Using cached pytaglib-1.4.6.tar.gz (468 kB)
Building wheels for collected packages: pytaglib
  Building wheel for pytaglib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/miniconda3/envs/xtr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c7oqfkoh/pytaglib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c7oqfkoh/pytaglib/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-qy9x4d3r
       cwd: /tmp/pip-install-c7oqfkoh/pytaglib/
  Complete output (19 lines):
  running bdist_wheel
  running build
  running build_py
  file src/pytaglib.py (for module pytaglib) not found
  creating build
  creating build/lib.linux-x86_64-3.6
  copying src/pyprinttags.py -> build/lib.linux-x86_64-3.6
  file src/pytaglib.py (for module pytaglib) not found
  running build_ext
  building 'taglib' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/src
  gcc -pthread -B /root/miniconda3/envs/xtr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/miniconda3/envs/xtr/include/python3.6m -c src/taglib.cpp -o build/temp.linux-x86_64-3.6/src/taglib.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  src/taglib.cpp:637:10: fatal error: taglib/tstring.h: No such file or directory
   #include "taglib/tstring.h"
            ^~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pytaglib
  Running setup.py clean for pytaglib
Failed to build pytaglib
Installing collected packages: pytaglib
    Running setup.py install for pytaglib ... error
    ERROR: Command errored out with exit status 1:
     command: /root/miniconda3/envs/xtr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c7oqfkoh/pytaglib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c7oqfkoh/pytaglib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-fmdjxik4/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/envs/xtr/include/python3.6m/pytaglib
         cwd: /tmp/pip-install-c7oqfkoh/pytaglib/
    Complete output (19 lines):
    running install
    running build
    running build_py
    file src/pytaglib.py (for module pytaglib) not found
    creating build
    creating build/lib.linux-x86_64-3.6
    copying src/pyprinttags.py -> build/lib.linux-x86_64-3.6
    file src/pytaglib.py (for module pytaglib) not found
    running build_ext
    building 'taglib' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -B /root/miniconda3/envs/xtr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/miniconda3/envs/xtr/include/python3.6m -c src/taglib.cpp -o build/temp.linux-x86_64-3.6/src/taglib.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    src/taglib.cpp:637:10: fatal error: taglib/tstring.h: No such file or directory
     #include "taglib/tstring.h"
              ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /root/miniconda3/envs/xtr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c7oqfkoh/pytaglib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c7oqfkoh/pytaglib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-fmdjxik4/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/envs/xtr/include/python3.6m/pytaglib Check the logs for full command output.

pip install . (from cloned github root)

Processing /root/git/pytaglib
Building wheels for collected packages: pytaglib
  Building wheel for pytaglib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/miniconda3/envs/xtr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-5xi5cy64/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-5xi5cy64/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-v9ikuh9z
       cwd: /tmp/pip-req-build-5xi5cy64/
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  file src/pytaglib.py (for module pytaglib) not found
  file src/pytaglib.py (for module pytaglib) not found
  running build_ext
  building 'taglib' extension
  gcc -pthread -B /root/miniconda3/envs/xtr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/miniconda3/envs/xtr/include/python3.6m -c src/taglib.cpp -o build/temp.linux-x86_64-3.6/src/taglib.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  src/taglib.cpp:637:10: fatal error: taglib/tstring.h: No such file or directory
   #include "taglib/tstring.h"
            ^~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pytaglib
  Running setup.py clean for pytaglib
Failed to build pytaglib
Installing collected packages: pytaglib
    Running setup.py install for pytaglib ... error
    ERROR: Command errored out with exit status 1:
     command: /root/miniconda3/envs/xtr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-5xi5cy64/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-5xi5cy64/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-l1tao94i/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/envs/xtr/include/python3.6m/pytaglib
         cwd: /tmp/pip-req-build-5xi5cy64/
    Complete output (19 lines):
    running install
    running build
    running build_py
    file src/pytaglib.py (for module pytaglib) not found
    creating build
    creating build/lib.linux-x86_64-3.6
    copying src/pyprinttags.py -> build/lib.linux-x86_64-3.6
    file src/pytaglib.py (for module pytaglib) not found
    running build_ext
    building 'taglib' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -B /root/miniconda3/envs/xtr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/miniconda3/envs/xtr/include/python3.6m -c src/taglib.cpp -o build/temp.linux-x86_64-3.6/src/taglib.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    src/taglib.cpp:637:10: fatal error: taglib/tstring.h: No such file or directory
     #include "taglib/tstring.h"
              ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /root/miniconda3/envs/xtr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-5xi5cy64/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-5xi5cy64/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-l1tao94i/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/envs/xtr/include/python3.6m/pytaglib Check the logs for full command output.

python setup.py build

running build
running build_py
file src/pytaglib.py (for module pytaglib) not found
file src/pytaglib.py (for module pytaglib) not found
running build_ext
building 'taglib' extension
gcc -pthread -B /root/miniconda3/envs/xtr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/miniconda3/envs/xtr/include/python3.6m -c src/taglib.cpp -o build/temp.linux-x86_64-3.6/src/taglib.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/taglib.cpp:637:10: fatal error: taglib/tstring.h: No such file or directory
 #include "taglib/tstring.h"
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

Config

$ hostnamectl
   Static hostname: ...
         Icon name: computer-container
           Chassis: container
        Machine ID: ...
           Boot ID: ...
    Virtualization: lxc
  Operating System: Ubuntu 18.04.1 LTS
            Kernel: Linux 4.15.0-51-generic
      Architecture: x86-64

$ pip --version
pip 20.0.2 from /root/miniconda3/envs/xtr/lib/python3.6/site-packages/pip (python 3.6)

$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Let me know if any more information would be useful. Advanced apologies if I've missed a dependency in the readme.

JamesOwers commented 4 years ago

SOLVED

Found the thing I'd missed in the README...

sudo apt-get -y install libtag1-dev

Perhaps worth highlighting?

supermihi commented 4 years ago

You are absolutely right. I put the apt command into the short installation section.

JamesOwers commented 4 years ago

Nice - thanks for the package ☺️ 👍

On Sun, 29 Mar 2020, 17:30 Michael Helmling, notifications@github.com wrote:

You are absolutely right. I put the apt command into the short installation section.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/supermihi/pytaglib/issues/74#issuecomment-605662965, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA24Q4ZJVEBHZEMRRBZDUK3RJ5ZT5ANCNFSM4LV6WQIQ .