Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Unable to Export Workflow with Python Tool: 'ExportVenvByNameToAFile' DLL Error

buddhiDB
7 - Meteor

I'm encountering an error when trying to export an Alteryx workflow that includes a Python tool. The error message is:

 

"Unable to find an entry point named 'ExportVenvByNameToAFile' in DLL 'VirtualEnvironmentManager.dll'"

 

The workflow exports successfully when I remove the Python tool, but fails when the Python tool is included, even if I add a new Python tool and paste the same code. During the export process, the Assets section lists a file at:

 

C:\Users\Alteryx\AppData\Local\Temp\Engine_7392_dcac550e1b414cf9a3fbb9ee38df2d46_\designerbasetools_venu.yml

 

This file appears to be related to the Python tool’s virtual environment, and the export fails when it’s included.

 

Python Code

 

# Efficiently updates a Word table in-place, preserving cell formatting.
from ayx import Alteryx
from docx import Document
import pandas as pd
from bs4 import BeautifulSoup
from docx.shared import RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.ns import nsdecls
from docx.oxml import OxmlElement

def clean_html_content(html_content):
    """Strips HTML tags from a string."""
    return BeautifulSoup(str(html_content), "html.parser").get_text()

try:
    # 1. Read input and output paths
    df_paths = Alteryx.read("#2")
    input_doc_path = df_paths['input_doc_path'].iloc[0]
    output_path = df_paths['output_path'].iloc[0]

    doc = Document(input_doc_path)

    if len(doc.tables) >= 3:
        # 2. Read and clean data
        df1 = Alteryx.read("#1")
        df1_cleaned = df1.apply(lambda col: col.map(clean_html_content))

        table = doc.tables[0]

        # 3. Update header row
        header_cells = table.rows[0].cells
        for col_idx, header_text in enumerate(df1_cleaned.columns):
            if col_idx < len(header_cells):
                cell = header_cells[col_idx]
                p = cell.paragraphs[0]
                p.clear()
                run = p.add_run(str(header_text))
                run.font.color.rgb = RGBColor(255, 255, 255)
                p.alignment = WD_ALIGN_PARAGRAPH.LEFT

        # 4. Update data rows and set alignment/wrapping
        num_data_rows = len(df1_cleaned)
        num_table_data_rows = len(table.rows) - 1

        for r_idx, data_row in df1_cleaned.iterrows():
            table_row_idx = r_idx + 1
            if r_idx < num_table_data_rows:
                # Update existing rows
                table_row = table.rows[table_row_idx]
                for c_idx, cell_value in enumerate(data_row):
                    if c_idx < len(table.columns):
                        cell = table_row.cells[c_idx]
                        cell.text = str(cell_value)
                        p = cell.paragraphs[0]
                        p.alignment = WD_ALIGN_PARAGRAPH.RIGHT if c_idx > 0 else WD_ALIGN_PARAGRAPH.LEFT
                        
                        # Set "no wrap" for columns after the first
                        if c_idx > 0:
                            tc = cell._tc
                            tcPr = tc.get_or_add_tcPr()
                            noWrap = OxmlElement('w:noWrap')
                            tcPr.append(noWrap)
            else:
                # Add new rows
                new_row_cells = table.add_row().cells
                for c_idx, cell_value in enumerate(data_row):
                    if c_idx < len(table.columns):
                        cell = new_row_cells[c_idx]
                        cell.text = str(cell_value)
                        p = cell.paragraphs[0]
                        p.alignment = WD_ALIGN_PARAGRAPH.RIGHT if c_idx > 0 else WD_ALIGN_PARAGRAPH.LEFT

                        # Also set "no wrap" for new cells
                        if c_idx > 0:
                            tc = cell._tc
                            tcPr = tc.get_or_add_tcPr()
                            noWrap = OxmlElement('w:noWrap')
                            tcPr.append(noWrap)

        # 5. Clear leftover rows
        if num_data_rows < num_table_data_rows:
            for i in range(num_data_rows, num_table_data_rows):
                row_to_clear = table.rows[i + 1]
                for cell in row_to_clear.cells:
                    cell.text = ""

        print("Table data successfully updated.")
        doc.save(output_path)
        print(f"Document saved to {output_path}")
    else:
        print("Document does not have the required number of tables.")

except Exception as e:
    Alteryx.write({"Error": [str(e)]}, 1)
    print(f"An error occurred: {e}")

 

Alteryx Version: 2025.1.2.79

 

1 REPLY 1
apathetichell
20 - Arcturus

open a ticket with support. alteryx should not be trying to include your VENV. question though --- do you have a second cell which manages your package import --- and if so can you share that?

Labels
Top Solution Authors