title: Python Pyinstaller Matplotlibrc
body: <p>Dear python experts in the world wide web,</p>
  <p>I really wish to get helped in this problem I have with pyinstaller.</p>
  <p>I wish to convert a python script to an executable so that i can distribute to my friends and colleagues.
  Previously, I have converted the same python script to .exe file however I have accidentally deleted that file and I now have a new machine that I have installed python 3.7.8, pyinstaller version 3.6 and matplotlib version 3.2.2.</p>
  <p>The .py file has tkinter library on it for a simple GUI and the rest is just data analytics that use numpy, pandas libraries and matplotlib fr data visualization. Additionally, there is a  yfinance library to pull stock data from yahoo finance website. The output of this program is just a pdf file of the matplotlib plots of chosen stock indexes.</p>
  <p>I can run this python code just fine in IDLE or jupyter notebook.</p>
  <p>But as i convert it to the executable, the program does not load up and in console i have the following error message:</p>
  <p><em>runtime error: could not find matplotlibrc file; your matplotlib install is broken</em></p>
  <p>I have tried to re-install matplotlib package to different version such as 3.0, 3.1.3, etc. but then i ended up with the same runtime error message.</p>
  <p>Could you please let me of what went wrong and how to overcome such problem?</p>
  <p>Below is the pyinstaller code that i used to convert the python to .exe:</p>
  <pre><code>C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool&gt;pyinstaller--onefile YFScrapping.py
  'pyinstaller--onefile' is not recognized as an internal or external command,
  operable program or batch file.
  
  C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool&gt;pyinstaller --onefile YFScrapping.py
  103 INFO: PyInstaller: 3.6
  103 INFO: Python: 3.7.8
  104 INFO: Platform: Windows-10-10.0.18362-SP0
  106 INFO: wrote C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool\YFScrapping.spec
  110 INFO: UPX is not available.
  113 INFO: Extending PYTHONPATH with paths
  ['C:\\Users\\isamshahab\\Desktop\\Work '
   'Stuffs\\CoC\\Stock\\StockIndexSummaryTool',
   'C:\\Users\\isamshahab\\Desktop\\Work '
   'Stuffs\\CoC\\Stock\\StockIndexSummaryTool']
  114 INFO: checking Analysis
  114 INFO: Building Analysis because Analysis-00.toc is non existent
  114 INFO: Initializing module dependency graph...
  120 INFO: Caching module graph hooks...
  133 INFO: Analyzing base_library.zip ...
  3509 INFO: Processing pre-find module path hook   distutils
  3510 INFO: distutils: retargeting to non-venv dir 'c:\\users\\isamshahab\\appdata\\local\\programs\\python\\python37\\lib'
  5744 INFO: Caching module dependency graph...
  5905 INFO: running Analysis Analysis-00.toc
  5908 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
    required by c:\users\isamshahab\appdata\local\programs\python\python37\python.exe
  6047 INFO: Analyzing C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool\YFScrapping.py
  11245 INFO: Processing pre-find module path hook   site
  11246 INFO: site: retargeting to fake-dir 'c:\\users\\isamshahab\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\fake-modules'
  13580 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
  31348 INFO: Processing pre-safe import module hook   six.moves
  31905 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
  64089 INFO: Processing module hooks...
  64090 INFO: Loading module hook &quot;hook-certifi.py&quot;...
  64092 INFO: Loading module hook &quot;hook-distutils.py&quot;...
  64094 INFO: Loading module hook &quot;hook-encodings.py&quot;...
  64226 INFO: Loading module hook &quot;hook-importlib_metadata.py&quot;...
  64228 INFO: Loading module hook &quot;hook-IPython.py&quot;...
  64830 INFO: Excluding import 'PyQt5'
  64836 INFO:   Removing import of PyQt5 from module IPython.external.qt_loaders
  64837 INFO: Excluding import 'PyQt4'
  64844 INFO:   Removing import of PyQt4 from module IPython.external.qt_loaders
  64845 INFO: Excluding import 'matplotlib'
  64852 INFO:   Removing import of matplotlib from module IPython.core.pylabtools
  64852 INFO:   Removing import of matplotlib.pyplot from module IPython.core.pylabtools
  64853 INFO:   Removing import of matplotlib.backend_bases from module IPython.core.pylabtools
  64853 INFO:   Removing import of matplotlib._pylab_helpers from module IPython.core.pylabtools
  64853 INFO:   Removing import of matplotlib.figure from module IPython.core.pylabtools
  64854 INFO: Excluding import 'gtk'
  64866 INFO: Excluding import 'tkinter'
  64874 INFO:   Removing import of tkinter from module IPython.lib.clipboard
  64877 INFO: Excluding import 'PySide'
  64885 INFO:   Removing import of PySide from module IPython.external.qt_loaders
  64886 INFO: Loading module hook &quot;hook-jedi.py&quot;...
  65251 INFO: Loading module hook &quot;hook-jinja2.py&quot;...
  65282 INFO: Loading module hook &quot;hook-jsonschema.py&quot;...
  65295 INFO: Loading module hook &quot;hook-lib2to3.py&quot;...
  65302 INFO: Loading module hook &quot;hook-lxml.etree.py&quot;...
  65308 INFO: Loading module hook &quot;hook-matplotlib.backends.py&quot;...
  Traceback (most recent call last):
    File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 1015, in &lt;module&gt;
      rcParams = rc_params()
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 878, in rc_params
      return rc_params_from_file(matplotlib_fname(), fail_on_error)
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 731, in matplotlib_fname
      for fname in gen_candidates():
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 728, in gen_candidates
      yield os.path.join(get_configdir(), 'matplotlibrc')
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 276, in wrapper
      ret = func(**kwargs)
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 609, in get_configdir
      return _get_config_or_cache_dir(_get_xdg_config_dir())
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 562, in _get_xdg_config_dir
      return os.environ.get('XDG_CONFIG_HOME') or str(Path.home() / &quot;.config&quot;)
  AttributeError: type object 'Path' has no attribute 'home'
  66344 INFO: Loading module hook &quot;hook-matplotlib.py&quot;...
  Traceback (most recent call last):
    File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 1015, in &lt;module&gt;
      rcParams = rc_params()
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 878, in rc_params
      return rc_params_from_file(matplotlib_fname(), fail_on_error)
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 731, in matplotlib_fname
      for fname in gen_candidates():
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 728, in gen_candidates
      yield os.path.join(get_configdir(), 'matplotlibrc')
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 276, in wrapper
      ret = func(**kwargs)
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 609, in get_configdir
      return _get_config_or_cache_dir(_get_xdg_config_dir())
    File &quot;c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\matplotlib\__init__.py&quot;, line 562, in _get_xdg_config_dir
      return os.environ.get('XDG_CONFIG_HOME') or str(Path.home() / &quot;.config&quot;)
  AttributeError: type object 'Path' has no attribute 'home'
  67281 INFO: Loading module hook &quot;hook-nbconvert.py&quot;...
  67303 INFO: Loading module hook &quot;hook-nbformat.py&quot;...
  67321 INFO: Loading module hook &quot;hook-notebook.py&quot;...
  69240 INFO: Loading module hook &quot;hook-numpy.core.py&quot;...
  69470 INFO: Loading module hook &quot;hook-numpy.py&quot;...
  69472 INFO: Loading module hook &quot;hook-pandas.py&quot;...
  70787 INFO: Loading module hook &quot;hook-PIL.Image.py&quot;...
  71389 INFO: Loading module hook &quot;hook-PIL.py&quot;...
  71398 INFO: Excluding import 'PyQt5'
  71425 INFO:   Removing import of PyQt5 from module PIL.ImageQt
  71452 INFO: Excluding import 'PyQt4'
  71491 INFO: Import to be excluded not found: 'FixTk'
  71516 INFO: Excluding import 'tkinter'
  71558 INFO:   Removing import of tkinter from module PIL.ImageTk
  71583 INFO: Excluding import 'PySide'
  71626 INFO: Loading module hook &quot;hook-PIL.SpiderImagePlugin.py&quot;...
  71661 INFO: Excluding import 'tkinter'
  71694 INFO: Import to be excluded not found: 'FixTk'
  71719 INFO: Loading module hook &quot;hook-pkg_resources.py&quot;...
  72388 INFO: Processing pre-safe import module hook   win32com
  73076 INFO: Excluding import '__main__'
  73082 INFO:   Removing import of __main__ from module pkg_resources
  73109 INFO: Loading module hook &quot;hook-pydoc.py&quot;...
  73135 INFO: Loading module hook &quot;hook-pygments.py&quot;...
  76203 INFO: Loading module hook &quot;hook-pythoncom.py&quot;...
  76821 INFO: Loading module hook &quot;hook-pytz.py&quot;...
  76942 INFO: Loading module hook &quot;hook-pywintypes.py&quot;...
  77544 INFO: Loading module hook &quot;hook-scipy.linalg.py&quot;...
  77547 INFO: Loading module hook &quot;hook-scipy.py&quot;...
  77588 INFO: Loading module hook &quot;hook-scipy.sparse.csgraph.py&quot;...
  77621 INFO: Loading module hook &quot;hook-scipy.special._ellip_harm_2.py&quot;...
  77652 INFO: Loading module hook &quot;hook-scipy.special._ufuncs.py&quot;...
  77687 INFO: Loading module hook &quot;hook-setuptools.py&quot;...
  78862 INFO: Loading module hook &quot;hook-sqlite3.py&quot;...
  79012 INFO: Loading module hook &quot;hook-sysconfig.py&quot;...
  79014 INFO: Loading module hook &quot;hook-ttkthemes.py&quot;...
  79567 INFO: Loading module hook &quot;hook-win32com.py&quot;...
  80368 INFO: Loading module hook &quot;hook-xml.dom.domreg.py&quot;...
  80369 INFO: Loading module hook &quot;hook-xml.etree.cElementTree.py&quot;...
  80401 INFO: Loading module hook &quot;hook-xml.py&quot;...
  80435 INFO: Loading module hook &quot;hook-zmq.py&quot;...
  80970 INFO: Loading module hook &quot;hook-_tkinter.py&quot;...
  81232 INFO: checking Tree
  81233 INFO: Building Tree because Tree-00.toc is non existent
  81271 INFO: Building Tree Tree-00.toc
  81416 INFO: checking Tree
  81417 INFO: Building Tree because Tree-01.toc is non existent
  81450 INFO: Building Tree Tree-01.toc
  81872 INFO: Looking for ctypes DLLs
  82072 INFO: Analyzing run-time hooks ...
  82111 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
  82116 INFO: Including run-time hook 'pyi_rth_pkgres.py'
  82122 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
  82153 INFO: Including run-time hook 'pyi_rth_traitlets.py'
  82188 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
  82221 INFO: Including run-time hook 'pyi_rth_mpldata.py'
  82254 INFO: Including run-time hook 'pyi_rth__tkinter.py'
  82287 INFO: Including run-time hook 'pyi_rth_certifi.py'
  82401 INFO: Looking for dynamic libraries
  85446 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\error.cp37-win_amd64.pyd
  85477 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\utils.cp37-win_amd64.pyd
  85494 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\socket.cp37-win_amd64.pyd
  85522 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\_poll.cp37-win_amd64.pyd
  85553 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\message.cp37-win_amd64.pyd
  85578 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\_proxy_steerable.cp37-win_amd64.pyd
  85609 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\_device.cp37-win_amd64.pyd
  85644 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\_version.cp37-win_amd64.pyd
  85672 WARNING: lib not found: libzmq.cp37-win_amd64.pyd dependency of c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\zmq\backend\cython\context.cp37-win_amd64.pyd
  87233 INFO: Looking for eggs
  87233 INFO: Using Python library c:\users\isamshahab\appdata\local\programs\python\python37\python37.dll
  87267 INFO: Found binding redirects:
  []
  87356 INFO: Warnings written to C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool\build\YFScrapping\warn-YFScrapping.txt
  88104 INFO: Graph cross-reference written to C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool\build\YFScrapping\xref-YFScrapping.html
  88721 INFO: checking PYZ
  88721 INFO: Building PYZ because PYZ-00.toc is non existent
  88750 INFO: Building PYZ (ZlibArchive) C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool\build\YFScrapping\PYZ-00.pyz
  95698 INFO: Building PYZ (ZlibArchive) C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool\build\YFScrapping\PYZ-00.pyz completed successfully.
  95874 INFO: checking PKG
  95875 INFO: Building PKG because PKG-00.toc is non existent
  95913 INFO: Building PKG (CArchive) PKG-00.pkg
  140236 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
  140777 INFO: Bootloader c:\users\isamshahab\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
  140777 INFO: checking EXE
  140810 INFO: Building EXE because EXE-00.toc is non existent
  140850 INFO: Building EXE from EXE-00.toc
  140889 INFO: Appending archive to EXE C:\Users\isamshahab\Desktop\Work Stuffs\CoC\Stock\StockIndexSummaryTool\dist\YFScrapping.exe
  141049 INFO: Building EXE from EXE-00.toc completed successfully.
  </code></pre>
  <p>Below is the screenshot of the error message from the console of the .exe file:</p>
  <p><a href="https://i.stack.imgur.com/V4WdS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V4WdS.jpg" alt="enter image description here" /></a></p>
  <p>thank you up front for your time and help.</p>
  <p>best regards,
  MH</p>