Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PyInstaller] Failed import of cbook due to upgrade to matplolib 2.2.0 #10758

Closed
massi82 opened this issue Mar 12, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@massi82
Copy link

commented Mar 12, 2018

Hi everyone,

I've currently upgraded matplotlib version of my software (on Windows 10, python 2.7) from 1.4 to 2.2.0 and now when I try to freeze it via PyInstaller (3.3.1) I get the following error:

  File "MyProg.pyw", line 19, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "gui\stage\MyProgStage.py", line 13, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "gui\stage\MyProgItem.py", line 13, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "components\MyProgCompSource.py", line 1, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "components\MyProgComponentBase.py", line 26, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "components\common\code\MyProgCodePanel.py", line 9, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "components\common\code\codepage.py", line 48, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "components\common\code\MyProgCodeTable.py", line 7, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "components\common\MyProgDelegate.py", line 10, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "designer\widgets\plottingmanager\PlotUtilities.py", line 1, in <module>
  File "C:\Users\user1\Desktop\Trunk3.2\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
    exec(bytecode, module.__dict__)
  File "site-packages\matplotlib\__init__.py", line 127, in <module>
ImportError: cannot import name cbook

I've also tried to include it in my hidden_import list:

block_cipher = None

a = Analysis(['../MyProg.pyw'],
             pathex=[HOMEPATH],
             binaries=None,
             datas=None,
             hiddenimports=['matplotlib.cbook'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)

Still I get the same error... any advice?
Just for the record here are the lines that seem to bother PyInstaller:

from . import cbook
from matplotlib.cbook import (
    _backports, mplDeprecation, dedent, get_label, sanitize_sequence)
@jklymak

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2018

This is better suited to the mailing list and/or stackexchange unless you have an explicit matplotlib bug to report. Thanks!

@jklymak jklymak closed this Mar 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.