Closed caseydm closed 2 years ago
Newer versions are more likely to work in your environment. Try again with the latest version.
Ok thank you!
Hi reopening because I initially thought the latest release worked. But I am getting the same error with 2.2.2. My python version is 3.9.5.
Can you provide full details of your setup?
I don't have a mac to do any testing, but all tests are passing in CI on macOS 10.15 and 11 with Python 2.7-3.10.
Sure! Here are the details:
MacOS 12.3.1 (iMac with M1 chip)
Installed python by going to https://www.python.org/downloads/macos/ and downloaded and installed python 3.9.12
Installed poppler by going into a terminal window and running brew install poppler
I used PyCharm to create a virtual environment for my project, selecting python 3.9
Go into the activated environment and install with pip install -r requirements.txt
. Within the requirements file there is a line pdftotext==2.2.2
Of note I tried to install on a Macbook Pro with similar config and got the same error message. Thank you for any help!
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 virtualenv
which python3
python3 -m venv test_venv
source test_env/bin/activate
pip install pdftotext
python -c 'import pdftotext'
If it works, you can then configure PyCharm to point to that existing virtual environment.
That worked! Thank you so much.
(docs) ai@learn % pip freeze | grep pdftotext ~
pdftotext==2.2.2
(docs) ai@learn % python -c 'import pdftotext' ~
Traceback (most recent call last):
File "
M2 macOS
hi there! Faced with the same issue with M3 MacOS:
$ python
Python 3.12.4 (main, Jun 26 2024, 14:44:41) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdftotext
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/dmitry/.pyenv/versions/ag-venv/lib/python3.12/site-packages/pdftotext.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '__ZN7poppler24set_debug_error_functionEPFvRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPvES9_'
Tried this using python from brew
and python from pyenv
Did you follow the steps in https://github.com/jalan/pdftotext/issues/100#issuecomment-1124001193 ?
Since there's about 9000 ways to install python and set up virtual envs and install libs and install packages, without knowing the details of your particular setup, I can't do much.
Hi 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: