Issue #183 resolved

matplotlib 1.5.1 doesn't package

Ian Bell
created an issue

I tried to package this simple test.cpp:

import matplotlib.pyplot as plt
plt.plot([1,2,3],[3,4,5])
plt.show()

with this setup.py:

import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os","matplotlib"], "excludes": ["tkinter"]}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(  name = "test",
        version = "0.1",
        description = "My GUI application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("test.py", base=base)])

and then when I do python setup.py build, I get:

Traceback (most recent call last):
  File "setup.py", line 17, in <module>
    executables = [Executable("test.py", base=base)])
  File "C:\Miniconda\lib\site-packages\cx_freeze-5.0-py2.7-win-amd64.egg\cx_Freeze\dist.py", line 337, in setup
    distutils.core.setup(**attrs)
  File "C:\Miniconda\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Miniconda\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Miniconda\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Miniconda\lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
  File "C:\Miniconda\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Miniconda\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Miniconda\lib\site-packages\cx_freeze-5.0-py2.7-win-amd64.egg\cx_Freeze\dist.py", line 207, in run
    freezer.Freeze()
  File "C:\Miniconda\lib\site-packages\cx_freeze-5.0-py2.7-win-amd64.egg\cx_Freeze\freezer.py", line 551, in Freeze
    self._WriteModules(fileName, self.finder)
  File "C:\Miniconda\lib\site-packages\cx_freeze-5.0-py2.7-win-amd64.egg\cx_Freeze\freezer.py", line 455, in _WriteModules
    module.Create(finder)
  File "C:\Miniconda\lib\site-packages\cx_freeze-5.0-py2.7-win-amd64.egg\cx_Freeze\freezer.py", line 652, in Create
    module.file, module.name)
cx_Freeze.freezer.ConfigError: no file named sys (for module collections.sys)

Comments (2)

  1. Franco C

    same problem on OSX 10.11, using this commit ).

    Was a solution ever found?

    line 24, in <module>
        from matplotlib.pylab import *
      File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
      File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/__init__.py", line 1132, in <module>
        rcParams = rc_params()
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/__init__.py", line 965, in rc_params
        fname = matplotlib_fname()
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/__init__.py", line 815, in matplotlib_fname
        path = get_data_path()  # guaranteed to exist or raise
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/__init__.py", line 320, in wrapper
        ret = func(*args, **kwargs)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/__init__.py", line 718, in _get_data_path_cached
        defaultParams['datapath'][0] = _get_data_path()
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/__init__.py", line 713, in _get_data_path
        raise RuntimeError('Could not find the matplotlib data files')
    RuntimeError: Could not find the matplotlib data files
    
  2. Log in to comment