Giter Club home page Giter Club logo

Comments (14)

DankeF avatar DankeF commented on July 29, 2024 2

@Belval
I found the cause of the problem:
PyCharm's terminal input pdfinfo command is not recognized.
image

Typing pdfinfo into the MAC terminal is identifiable.
image

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.

janipez avatar janipez commented on July 29, 2024 2

https://intellij-support.jetbrains.com/hc/en-us/community/posts/208567485-Pycharm-terminal-is-missing-part-of-PATH

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.

Belval avatar Belval commented on July 29, 2024 1

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.

DankeF avatar DankeF commented on July 29, 2024 1

@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.
image
image

from pdf2image.

gopikrishnareddy93 avatar gopikrishnareddy93 commented on July 29, 2024 1

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.

TACHENZHICHAO avatar TACHENZHICHAO commented on July 29, 2024 1

@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.

Belval avatar Belval commented on July 29, 2024

Hi!

First, open a terminal and try to invoke pdfinfo manually to see if your installation was successful.

from pdf2image.

DankeF avatar DankeF commented on July 29, 2024

@Belval
Thank you for your reply. Pdfinfo can be output correctly。
image

from pdf2image.

DankeF avatar DankeF commented on July 29, 2024

@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'
image

from pdf2image.

Belval avatar Belval commented on July 29, 2024

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.

Belval avatar Belval commented on July 29, 2024

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.

Belval avatar Belval commented on July 29, 2024

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.

NicoLivesey avatar NicoLivesey commented on July 29, 2024

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.

glushakviktor avatar glushakviktor commented on July 29, 2024

I had same problems on Centos 7 server (on Ubuntu apt-get instead yum ).
My solution:

  1. install pdfinfo (it is in package poppler-utils)

sudo yum update -y
sudo yum install -y poppler-utils

  1. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.