No module named when using PyInstaller

后端 未结 7 1966
说谎
说谎 2020-11-27 15:11

I try to compile a Python project under Windows 7 using PyInstaller. The project works fine, there are no issues, however when I try to compile it the result doesn\'t work.

7条回答
  •  佛祖请我去吃肉
    2020-11-27 15:56

    If the matter is that you don't need Tkinter and friends because you are using PyQt4, then it might be best to avoid loading Tkinter etc altogether. Look into /etc/matplotlibrc and change the defaults to PyQt4, see the 'modified' lines below:

    #### CONFIGURATION BEGINS HERE
    
    # The default backend; one of GTK GTKAgg GTKCairo GTK3Agg GTK3Cairo
    # CocoaAgg MacOSX Qt4Agg Qt5Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG
    # Template.
    # You can also deploy your own backend outside of matplotlib by
    # referring to the module name (which must be in the PYTHONPATH) as
    # 'module://my_backend'.
    
    #modified 
    #backend      : TkAgg
    backend      : Qt4Agg
    
    
    # If you are using the Qt4Agg backend, you can choose here
    # to use the PyQt4 bindings or the newer PySide bindings to
    # the underlying Qt4 toolkit.
    
    #modified 
    #backend.qt4 : PyQt4        # PyQt4 | PySide
    backend.qt4 : PyQt4        # PyQt4 | PySide
    

提交回复
热议问题