简体   繁体   English

NameError:运行使用 Pyinstaller 转换的 .exe 时未定义名称“defaultParams”

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

I successfully converted the main.py script using pyinstaller.我使用 pyinstaller 成功转换了main.py脚本。 However the below stated error is thrown while executing the .exe file for the same.但是,在执行相同的.exe文件时会引发以下错误。

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

Supposedly, all you can do to fix this is to downgrade your matplotlib to the version:据推测,您可以做的就是将您的 matplotlib 降级到以下版本:

pip install matplotlib==3.2.2

Apparently, the latest version of matplotlib meddles with the environment variable in the windows path.显然,最新版本的 matplotlib 干扰了 windows 路径中的环境变量。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PyQT / Windows / Pyinstaller(exe)-NameError:未定义全局名称“ QtGui” - PyQT / Windows / Pyinstaller (exe) - NameError: global name 'QtGui' is not defined Pyinstaller 转换的 exe 文件不在 windows 7 上运行 - Pyinstaller converted exe files not running on windows 7 Pyinstaller,NameError:未定义全局名称'quit' - Pyinstaller, NameError: global name 'quit' is not defined 在virtualenv上运行时,Django“ NameError:名称&#39;未定义数据库&#39; - Django "NameError: name 'Database is not defined' while running on virtualenv 我使用 pyinstaller 和 py-to-exe 将 my.py 转换为 .exe,但在执行时出现错误 - I converted my .py into .exe using pyinstaller and py-to-exe but i am getting error while executing Pyinstaller 使用 tkinter 从 py 文件转换的 exe 文件运行时出现黑屏 - Black Screen while running exe file converted from py file with tkinter by Pyinstaller NameError:XPATH使用Selenium查找元素时未定义名称“ btn” - NameError: name 'btn' is not defined while find element by XPATH using Selenium NameError: 名称“文件”未定义。 使用 tkinter 线程时 - NameError: name 'file' is not defined. while using tkinter Thread 由pyinstaller创建的exe文件,在运行时找不到自定义模块 - exe-file created by pyinstaller, not find self-defined modules while running NameError: 使用 google colab 时未定义名称“转换” - NameError: name 'transforms' is not defined, while using google colab
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM