dce
dce

Reputation: 91

py2exe and Tableau Python API

First of all, please excuse me if I'm using some of the terminology incorrectly (accountant by trade ...)

I'm writing a piece of code that I was planning to pack as .exe product.

I've already included number of standard libraries (xlrd, csv, math, operator, os, shutil, time, datetime, and xlwings). Unfortunately, when I've added 'dataextract' library my program stopped working.

dataextract is an API written specifically for software called Tableau (one of the leading BI solutions on the market). Also Tableau website says it does not provide any maintenance support for it at the moment.

I've tested it on very basic setup:

from xlwings import Workbook, Sheet, Range
Workbook.set_mock_caller(r'X:\JAC Reporting\Tables\Pawel\Development\_DevXL\Test1.xlsx') 
f = Workbook.caller()
s = raw_input('Type in anything: ') 
Range(1, (2, 1)).value = s

This works perfectly fine. After adding:

import dataextract as tde

The Console (black box) will only flash on the screen and nothing happens.

Questions:

  1. Does library (in this case 'dataextract') has to meet certain criteria to be compatible with py2exe?

  2. As Tableau does not maintain the original code, does it mean I won't be able to pack it into .exe using py2exe?

Finally: I'm using 'dataextract' for almost 2 years now and as long as you will run the program through .py file it works like a charm :) I just decided to take it one step further.

Any comments/input would be greatly appreciated.

EDIT: Not sure does it help or not, but when I tried to run the same script using cx_Freeze compiler got below error:

Error msg

Upvotes: 1

Views: 238

Answers (1)

dce
dce

Reputation: 91

First of all massive thanks to @Andris as he pointed me at the correct direction.

It turned out dataextrac library dlls are not automatically copied while compiler is running. Therefore you need to copy them from 'site-package/dataextrac/bin' into 'dist' folder.

Also from 12 dlls you only need 9 of them (I tried running exe file for each of them). One you don't need are: icin44.dll, msvcp100.dll and msvcr100.dll.

To be on the safe side I will be coping them anyway though.

Hope this post will be any help to otheres :)

Upvotes: 1

Related Questions