Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NameError: name 'defaultParams' is not defined while running the .exe converted using Pyinstaller

I successfully converted the main.py script using pyinstaller. However the below stated error is thrown while executing the .exe file for the same.

MatplotlibDeprecationWarning: Matplotlib installs where the data is not in the mpl-data subdirectory of the package are deprecated since 3.2 and support for them will be removed two minor releases later.
  exec(bytecode, module.__dict__)
Traceback (most recent call last):
  File "main.py", line 8, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "matplotlib\__init__.py", line 898, in <module>
  File "matplotlib\cbook\__init__.py", line 480, in _get_data_path
  File "matplotlib\__init__.py", line 239, in wrapper
  File "matplotlib\__init__.py", line 534, in get_data_path
  File "matplotlib\__init__.py", line 239, in wrapper
  File "matplotlib\__init__.py", line 563, in _get_data_path
NameError: name 'defaultParams' is not defined
like image 756
Jimit Vaghela Avatar asked Aug 20 '20 11:08

Jimit Vaghela


1 Answers

Supposedly, all you can do to fix this is to downgrade your matplotlib to the version:

pip install matplotlib==3.2.2

Apparently, the latest version of matplotlib meddles with the environment variable in the windows path.

like image 162
Jimit Vaghela Avatar answered Nov 15 '22 04:11

Jimit Vaghela