fsociety
fsociety

Reputation: 1027

py2exe error when running exe file

I have successfully converted .py file to .exe file using py2exe. I can successfully run the .py file,if i run it standalone.However, when iam trying to run the .exe file, it throws an error as seen in attached image.

In my .py file, i have the below import statements:

import xlrd,xlwt,xlutils.copy,re,time,openpyxl,os
from openpyxl.styles import Alignment
from openpyxl import load_workbook

I have also accordingly tweaked setup.py file to include these packages as below setup.py code shows

from distutils.core import setup
import py2exe

setup(
    console=['vu_t2.py'],
    options = {
        'py2exe': {
            'packages': ['xlrd','xlwt','xlutils','openpyxl','openpyxl.workbook']
        }
    }
)

Please refer the attached error snapshotenter image description here

I used the below command to run py2exe

python setup.py py2exe

Upvotes: 0

Views: 668

Answers (1)

Charlie Clark
Charlie Clark

Reputation: 19497

openpyxl only supports distribution via pip.

Upvotes: 2

Related Questions