Recurring Module Errors in “Escrita Acadêmica”

Dear Pickaxe.co Support Team,

I hope you’re well. I’m writing from the Acadêmico 24h studio regarding persistent failures in my Escrita Acadêmica Action (ID EQUIPEID). Below is a detailed account of every issue encountered during this session—and the steps already taken to address them—so that you can help identify what may still be going wrong.


1. Pillow (PIL) Import Failures

image.png

  • Error Messages:

    ModuleNotFoundError: No module named 'PIL'
    

    AttributeError: module 'PIL' has no attribute 'Image'

  • Context: Occurs immediately after uploading any PDF or image, before any OCR or image conversion runs.

  • What I’ve Tried:

    1. Added Pillow under Additional packages in the Action settings.

    2. Implemented dynamic import logic:

      try:
      

      PIL = importlib.import_module("PIL") Image = PIL.Image except ImportError: subprocess.run([sys.executable, "-m", "pip", "install", "Pillow"]) PIL = importlib.import_module("PIL") Image = PIL.Image

    3. Redeployed and restarted the Action multiple times.

Despite confirming “installation succeeded” in the logs, the module remains unreachable at execution time.


2. Dynamic Dependencies for Other Libraries

Each of the following modules also uses the same dynamic-import pattern, and none have been accessible despite successful “install” logs:

Module Package Name Import Pattern
python-docx python-docx docx = importlib.import_module("docx")
PyMuPDF (fitz) PyMuPDF fitz = importlib.import_module("fitz")
pandas pandas pd = importlib.import_module("pandas")
tabulate tabulate tabulate = importlib.import_module("tabulate")
pytesseract pytesseract same pattern
textract textract same pattern
whisper whisper same pattern
moviepy.editor moviepy import moviepy.editor
beautifulsoup4 beautifulsoup4 import bs4
python-pptx python-pptx import pptx
openai openai import openai

All above modules report “installation successful” yet still raise ImportError at runtime.


3. Other Errors Encountered

Whenever the Action attempts to embed base64-encoded images into the chat (for OCR previews), I sometimes see:

Image build for im-<ID> failed with the exception: <exception message>

I’ve not been able to capture a full stack trace of that particular failure, but it correlates with any call to:

data_uri = f"data:{mime};base64,{b64}"

and subsequent insertion into the messages list.


4. Steps Already Taken

  1. Additional Packages: Listed every dependency under Additional packages.

  2. Dynamic Imports: Consolidated all imports under a uniform importlib-based helper.

  3. Redeployment: Re-saved and restarted the Action after each change.

  4. Environment Check: Confirmed that no external “system” or virtual-environment setup is possible—everything must happen in-code.


5. Requested Assistance

  1. Verify Runtime Behavior: Does the Pickaxe.co sandbox truly install and expose newly added packages at runtime?

  2. Correct Package Names/Versions: Are there specific version constraints (e.g. Pillow==9.0.0, moviepy==2.0.0) required?

  3. Sandbox/Caching Issues: Could a caching layer or sandbox isolation prevent freshly installed modules from being loaded?

  4. Image-Embedding Failures: What are the correct limits or formats for base64-image messages to avoid “Image build… failed” errors?

Thank you for your time and support. Please let me know if you need any further logs, screenshots, or code snippets.


Best regards,
Marcos Andrade
Escrita Acadêmica Assistant
Acadêmico 24h Studio
Action ID: EQUIPEID

Responded in the support inbox.

Hi Marcos, thank you for your detailed message. I wanted to let you know that we have responded to this message in our support inbox. Please check your email for our reply, and feel free to send any follow-up questions there.