Comments (14)
@Belval
I found the cause of the problem:
PyCharm's terminal input pdfinfo command is not recognized.
Typing pdfinfo into the MAC terminal is identifiable.
This means that the terminal in PyCharm cannot read the environment variable of ~/.bash_profile, I only need to run the program in the system terminal.
Thank you for every reply, let me get the idea.
from pdf2image.
The problem seems to happen only with "shell integration" enabled.
If I uncheck Tools > Terminal > "shell integration" terminal will load normally, with full $PATH and normal settings.
from pdf2image.
Indeed, this is a probably a real bug then. Unfortunately the current code hides the actual exception.
If you would be so kind, please edit https://github.com/Belval/pdf2image/blob/master/pdf2image/pdf2image.py#L186 to print the actual exception so I'll be more able to help you. Something like:
except Exception as ex:
raise ex
Would do the trick.
You can edit it directly in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pdf2image/pdf2image.py
(the path in your flask stacktrace)
from pdf2image.
@Belval
I tried to write a typical python script. It will still report an error. I am confused why I can't find the pdfinfo command.
from pdf2image.
We ran into this issue when we were building release package using jenkins, we were able to resolve this issue by updating the permissions on the poppler_binaries directory, execute the below command to fix the permissions.
chmod ugo+rwx -R package/poppler_binaries
from pdf2image.
@Belval
我试图编写一个典型的python脚本。它仍然会报告错误。我很困惑为什么找不到pdfinfo命令。
Haven't you solved it yet?Download poppler-0.68.0_x86,and add path: ''C:\poppler-0.68.0\bin''.
Your Finished
from pdf2image.
Hi!
First, open a terminal and try to invoke pdfinfo manually to see if your installation was successful.
from pdf2image.
@Belval
Thank you for your reply. Pdfinfo can be output correctly。
from pdf2image.
@Belval
I edited pdf2image.py according to your instructions, and then ran the program to output this error: FileNotFoundError: [Errno 2] No such file or directory: 'pdfinfo': 'pdfinfo'
from pdf2image.
I don't have a machine with OSX to test, but I think this could be related to flask. It is possible that it's running in a special instance, like a docker container? Try running your conversion code as a typical python script.
A good test would be to simply spawn a live python shell, import pdf2image, and convert the PDF in there.
from pdf2image.
That would probably boil down to how OSX deals with installation I suppose, maybe it needs to be installed in system PATH? Or there is a special process to make is accessible to other processes?
I'm really making blind guesses here as I have no way to test without a Mac.
from pdf2image.
Glad you got it sorted out!
I'll be closing this for now, as I do not think much can be done on pdf2image
side to fix this.
from pdf2image.
Hello,
I'm having the same problem in a docker container and I can't find the package/poppler_binaries
directory in it. Do you have other insight to solve this problem ?
from pdf2image.
I had same problems on Centos 7 server (on Ubuntu apt-get instead yum ).
My solution:
- install pdfinfo (it is in package poppler-utils)
sudo yum update -y
sudo yum install -y poppler-utils
- wrap try-except string 186 in pdf2image.py (my path is something like that venv/lib/site-packages/pdf2image):
try:
processes.append(
(thread_output_file, Popen(args, env=env, stdout=PIPE, stderr=PIPE))
)
except Exception as err:
print(err)
from pdf2image.
Related Issues (20)
- convert_from_bytes has wrong argument name or docstring
- Missing characters like "Ň č ľ 付" when converting a fillable pdf form to image HOT 6
- Missing py.typed file HOT 4
- Wrong image converted HOT 2
- No source release on pypi for 1.16.3 HOT 1
- Inconsistent results between servers with the same code and PDF file HOT 2
- Problem converting from Image coordinates to PDF coordinates
- Invalid SOS parameters for sequential JPEG
- Adding conda poppler to PATH HOT 1
- Lossless conversion HOT 3
- weird CMYK and text at top of output image
- Missing optional arguments in pdfinfo_from_bytes and pdfinfo_from_path HOT 2
- `Page rot` metadata and `size` param interact incorrectly in convert_from_path() HOT 5
- When a pdf is converted to a picture, it takes up a very small part of the picture
- Add an option to start counter generator at index 0 HOT 1
- FileNotFoundError with poppler_path HOT 1
- Is there way to control rotation?
- Some missing words from converting PDF to Image
- OSS-Fuzz Integration HOT 3
- Feature: Specific pages to convert.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf2image.