Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError symbol not found #114

Open
javanasse opened this issue Sep 13, 2023 · 9 comments
Open

ImportError symbol not found #114

javanasse opened this issue Sep 13, 2023 · 9 comments

Comments

@javanasse
Copy link

Hello. I am trying to install this package, and while the installation is successful (with some depreciation warnings) when I import the package into a project anImportError is thrown.

>>> ipython
Python 3.11.5 (main, Aug 24 2023, 15:09:32) [Clang 14.0.0 (clang-1400.0.29.202)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import taglib
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 import taglib

ImportError: dlopen(/opt/homebrew/lib/python3.11/site-packages/taglib.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '__ZN6TagLib10StringList6appendERKNS_6StringE'
@anthonyscorrea
Copy link

I was able to fix/workaround this by cloning and using build_taglib.py and pip install . (in my case, I was also getting cmake errors, but a xcode-select --install fixed that error).

@supermihi
Copy link
Owner

are you on arm64?

@frederictriquet
Copy link

frederictriquet commented Nov 20, 2023

Hi, I'm on arm64 (macbook air m2) and I have the same issue.
I have installed the taglib brew package too.
I will try @anthonyscorrea 's workaround.

@supermihi
Copy link
Owner

I'm using cibuildwheel to build the binaries. According to their documentation, Apple silicon should work (and the build itself succeeds).

The fact that @anthonyscorrea's fix of local compilation works indicates that it is an issue with cross-compilation. Not sure what we can do here, except waiting for updates and / or native arm64 GitHub runners.

@supermihi
Copy link
Owner

Did you try the latest version 2.1.0 (released a few days ago)?

@Esgrove
Copy link

Esgrove commented Nov 22, 2023

I tried the latest, same issue and local build fails on my M1 Pro. Taglib is installed from homebrew.

@Esgrove
Copy link

Esgrove commented Nov 22, 2023

I managed to build it locally now by first running python build_taglib.py, which installs taglib to the place the pip install is expecting /Users/akseli/Developer/pytaglib/build/taglib/Darwin-x64-py3.11.6/include and /Users/akseli/Developer/pytaglib/build/taglib/Darwin-x64-py3.11.6/lib/.

Then I managed to run pip install . successfully and run pyprinttags.

Now I still need to figure out how to get poetry to use the wheel I build locally to get it actually working in my project 😅

@Esgrove
Copy link

Esgrove commented Nov 22, 2023

python -m build still fails though 🤔

running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-14-arm64-cpython-311
copying src/pyprinttags.py -> build/lib.macosx-14-arm64-cpython-311
running egg_info
writing src/pytaglib.egg-info/PKG-INFO
writing dependency_links to src/pytaglib.egg-info/dependency_links.txt
writing entry points to src/pytaglib.egg-info/entry_points.txt
writing requirements to src/pytaglib.egg-info/requires.txt
writing top-level names to src/pytaglib.egg-info/top_level.txt
reading manifest file 'src/pytaglib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'src/pytaglib.egg-info/SOURCES.txt'
running build_ext
building 'taglib' extension
creating build/temp.macosx-14-arm64-cpython-311
creating build/temp.macosx-14-arm64-cpython-311/src
clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -I/private/var/folders/hy/f8xmp3xj653_941p9vnkn0040000gn/T/build-via-sdist-7jt6at6v/pytaglib-2.1.0/build/taglib/Darwin-x64-py3.11.6/include -I/private/var/folders/hy/f8xmp3xj653_941p9vnkn0040000gn/T/build-env-0qeyd5qa/include -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/taglib.cpp -o build/temp.macosx-14-arm64-cpython-311/src/taglib.o
clang++ -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk build/temp.macosx-14-arm64-cpython-311/src/taglib.o -L/private/var/folders/hy/f8xmp3xj653_941p9vnkn0040000gn/T/build-via-sdist-7jt6at6v/pytaglib-2.1.0/build/taglib/Darwin-x64-py3.11.6/lib -L/private/var/folders/hy/f8xmp3xj653_941p9vnkn0040000gn/T/build-via-sdist-7jt6at6v/pytaglib-2.1.0/build/taglib/Darwin-x64-py3.11.6/lib64 -ltag -o build/lib.macosx-14-arm64-cpython-311/taglib.cpython-311-darwin.so
ld: warning: search path '/private/var/folders/hy/f8xmp3xj653_941p9vnkn0040000gn/T/build-via-sdist-7jt6at6v/pytaglib-2.1.0/build/taglib/Darwin-x64-py3.11.6/lib' not found
ld: warning: search path '/private/var/folders/hy/f8xmp3xj653_941p9vnkn0040000gn/T/build-via-sdist-7jt6at6v/pytaglib-2.1.0/build/taglib/Darwin-x64-py3.11.6/lib64' not found
ld: library 'tag' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang++' failed with exit code 1

ERROR Backend subprocess exited when trying to invoke build_wheel

@cweaver-logitech
Copy link

I've got the same issue and solved it by installing from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants