Symbol not found in flat namespace
See original GitHub issueHi all. I’m getting this error when trying to import pdftotext in a flask project and cannot figure out how to resolve it.
ImportError: dlopen(/Users/casey/PycharmProjects/virtual environments/oadoi/lib/python3.9/site-packages/pdftotext.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '__ZN7poppler24set_debug_error_functionEPFvRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPvES9_'
My installation details are:
- Mac M1
- pdftotext version 2.1.5
- Installed poppler with homebrew, set to version 22.04.0
- Ensured poppler visible to pdftotext by setting these environment variables in my shell:
export LDFLAGS="-L/opt/homebrew/opt/openssl/lib -L/opt/homebrew/lib $LDFLAGS"
export CPPFLAGS="-I/opt/homebrew/opt/openssl/include -I/opt/homebrew/include $CPPFLAGS"
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
What does "Symbol not found / Expected in: flat namespace ...
Symbol not found means the definition of the declared function or variable was not found. When a header file of a ...
Read more >symbol not found in flat namespace (protobuf 3.20.2) · Issue ...
Same: macOS 12.6, Python 3.10.6, protobuf==3.20.2 and Mac M1. For me, I am not using even using Protobuf, but one of the dependencies...
Read more >symbol not found in flat namespace '_FT_Done_Face'
The reason is that reportlab is not able to find freetype library which render fonts. Solution. Force pip to build reportlab package again...
Read more >Symbol Not Found Error: Tensorflow Metal for Apple M1
... Expected in: flat namespace. I have seen similar issues reported related to the "Symbol not found: " portion of the traceback, but...
Read more >[reportlab-users] Symbol not found in flat namespace when ...
[reportlab-users] Symbol not found in flat namespace when running on macOS ... I suspect freetype should be listed there as a load command,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That worked! Thank you so much.
I wonder if there’s some conflict between the things you installed via brew and the things you have installed otherwise. I would suggest first trying to see if you can get it all to work with only brew, on the command line, without a separately installed copy of Python and without PyCharm.
If you’re willing to give it a try, here’s how (as best I can remember):
brew install pkg-config poppler python3 virtualenvwhich python3python3 -m venv test_venvsource test_env/bin/activatepip install pdftotextpython -c 'import pdftotext'If it works, you can then configure PyCharm to point to that existing virtual environment.