I was trying to convert program written in python 3 to .exe using cx_freeze and py2exe. But after converting and running program i get the following error:
Traceback (most recent call last):
File "astroConverter.py", line 8, in <module>
File "C:\Users\Konrad\PycharmProjects\astroConverter\mainwindow.py", line 2, in <module>
from widgets.widgets import MainMenu, Toolbar, TextField
File "C:\Users\Konrad\PycharmProjects\astroConverter\widgets\widgets.py", line 1, in <module>
from widgets.menus import FileMenu, EditMenu, HelpMenu
File "C:\Users\Konrad\PycharmProjects\astroConverter\widgets\menus.py", line 2, in <module>
from common import Info
File "C:\Users\Konrad\PycharmProjects\astroConverter\common.py", line 2, in <module>
from astropy.io import fits
File "C:\Python34\lib\site-packages\astropy\__init__.py", line 73, in <module>
_check_numpy()
File "C:\Python34\lib\site-packages\astropy\__init__.py", line 61, in _check_numpy
from .utils import minversion
File "C:\Python34\lib\site-packages\astropy\utils\__init__.py", line 15, in <module>
from .codegen import *
File "C:\Python34\lib\site-packages\astropy\utils\codegen.py", line 15, in <module>
from .introspection import find_current_module
File "C:\Python34\lib\site-packages\astropy\utils\introspection.py", line 14, in <module>
from ..extern import six
File "C:\Python34\lib\site-packages\astropy\extern\six.py", line 60, in <module>
_import_six()
File "C:\Python34\lib\site-packages\astropy\extern\six.py", line 57, in _import_six
"distribution.".format(_SIX_MIN_VERSION))
ImportError: Astropy requires the 'six' module of minimum version 1.7.3; normally this is bundled wi
th the astropy package so if you get this warning consult the packager of your Astropy distribution.
This is my cx_freeze setup.py script:
import sys
from cx_Freeze import setup, Executable
buildExeOptions = {"packages": ["astropy", "numpy", "matplotlib"],
"includes": ["six"],
"silent": ["-s"]}
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
setup(name='astroConverter',
version="0.4",
description="Format converter used in astronomy",
options={"build_exe": buildExeOptions},
executables=[Executable("astroConverter.py", base=base)]
)
and py2exe script:
from distutils.core import setup
import py2exe
setup(console=['astroConverter.py'])
Here is output for pip freeze
:
C:\WINDOWS\system32>pip freeze
astropy==1.0.1
cx-Freeze==4.3.4
matplotlib==1.4.3
numpy==1.9.2
py2exe==0.9.2.2
pyparsing==2.0.3
python-dateutil==2.4.1
pytz==2015.2
six==1.9.0
UNKNOWN==0.0.0
virtualenv==13.1.0
As you can see, my six
module is in newer version than required by astropy.
Strange thing is, i have all packages properly installed, and while running python astroConverter.py
everything works fine. This is GUI application (it's using tkinter). Does anyone know how can i force cx_freeze or py2exe to properly include "six" module?