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

Failed to import fitz on IBM Cloud Function #740

Closed
anilomanwar opened this issue Nov 30, 2020 · 2 comments
Closed

Failed to import fitz on IBM Cloud Function #740

anilomanwar opened this issue Nov 30, 2020 · 2 comments
Assignees
Labels
bug duplicate wontfix no intention to resolve

Comments

@anilomanwar
Copy link

I am facing the same issue as #430 for IBM Cloud Function (similar to AWS Lambda)

I have used same build step
"pip install PyMuPDF -t ." in deployment step and can see folder structure
mentioned in #430 (comment)

In My code,

import fitz

and getting below error -
"2020-11-26T07:23:33.653912Z stderr: Traceback (most recent call last):",
"2020-11-26T07:23:33.653966Z stderr: File "exec__.py", line 42, in ",
"2020-11-26T07:23:33.653971Z stderr: from main__ import main as main",
"2020-11-26T07:23:33.653976Z stderr: File "/action/1/bin/main__.py", line 30, in ",
"2020-11-26T07:23:33.653980Z stderr: import fitz",
"2020-11-26T07:23:33.653984Z stderr: File "/action/1/bin/fitz/init.py", line 3, in ",
"2020-11-26T07:23:33.653988Z stderr: from fitz.fitz import *",
"2020-11-26T07:23:33.653992Z stderr: File "/action/1/bin/fitz/fitz.py", line 17, in ",
"2020-11-26T07:23:33.653996Z stderr: from . import _fitz",
"2020-11-26T07:23:33.654001Z stderr: ImportError: cannot import name '_fitz' from 'fitz' (/action/1/bin/fitz/init.py)",
"2020-11-26T07:23:33.785866Z stderr: Command exited abruptly during initialization.",
"2020-11-26T07:23:33.786Z stderr: The action did not initialize or run as expected. Log data might be missing."

I tried 2-3 ways doing this but getting same issue
like
"pip install PyMuPDF"
"pip install PyMuPDF==1.16.10 -t ."
"pip install PyMuPDF==1.18.10 -t ."

I am using other packages like pypdf, pdfminer using same way and they are working fine but not this one..

Not got any issues during build step only getting issue for import statement.

@JorjMcKie
Copy link
Collaborator

The other packages you mentioned are all pure Python - that's why the are working without issues.
Your problem goes back to the fact that PyMuPDF is not.
To solve, please find out how your cloud provider supports uploading packages containing binaries.
The procedure presumably is different with every provider and has nothing to do with PyMuPDF itself.

I am not using any of these services so regrettably cannot help.

@JorjMcKie JorjMcKie added the wontfix no intention to resolve label Nov 30, 2020
@JorjMcKie
Copy link
Collaborator

Duplicate of #430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug duplicate wontfix no intention to resolve
Projects
None yet
Development

No branches or pull requests

2 participants