Skip to content

Commit 8cd7551

Browse files
author
Kevin Morey
committed
Modify setup.py to allow cx_freeze from virtualenv
Solution came from here: http://stackoverflow.com/questions/14247130/cxfreeze-missing-distutils-module-inside-virtualenv TL:DR; distutils in a virtualenv is modified and cxfreeze doesn't work properly. Workaround is to use the system distutils when freezing instead.
1 parent dad4b3e commit 8cd7551

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setup.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import matplotlib
44
from setuptools import find_packages
55
from cx_Freeze import setup, Executable
6+
import distutils
7+
import opcode
68

79

810
# Read in long description and requirements.
@@ -23,6 +25,7 @@
2325

2426
# Detetermine platform and define setup.
2527
if sys.platform == 'win32':
28+
distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils')
2629
setup(
2730
name=name,
2831
version=version,
@@ -39,14 +42,15 @@
3942
'includes': [
4043
'matplotlib',
4144
'serial',
42-
'distutils',
4345
'matplotlib.backends.backend_qt5agg'],
4446
'include_files': [
4547
'static',
4648
'openroast/views',
4749
'openroast/controllers',
4850
'LICENSE',
49-
(matplotlib.get_data_path(), 'mpl-data')],
51+
(matplotlib.get_data_path(), 'mpl-data'),
52+
(distutils_path, 'distutils')],
53+
'excludes': ['distutils'],
5054
'icon': 'static/icons/openroast-windows.ico',
5155
'include_msvcr': True
5256
},

0 commit comments

Comments
 (0)