简体   繁体   English

exe文件在Anaconda提示window但在Windows命令行不工作

[英]exe file works in Anaconda Prompt window but not in Windows command line

My python code include tkinter and matplotlib. I create a.exe with pyinstaller.我的python代码包括tkinter和matplotlib。我用pyinstaller创建了一个.exe。 When I run the exe I get this message:当我运行 exe 时,我收到此消息:

appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:623:
MatplotlibDeprecationWarning: The MATPLOTLIBDATA environment variable
was deprecated in Matplotlib 3.1 and will be removed in 3.3.  
exec(bytecode, module.__dict__)

When I run it with Anaconda Prompt, the message appears and my interface run normally.当我以 Anaconda 提示符运行它时,出现该消息并且我的界面运行正常。 If I run it with Windows command line (or double clik) the message appears but no interface appears.如果我使用 Windows 命令行(或双击)运行它,则会出现消息但不会出现界面。

If I suppress matplotlib import, the exe works with Windows command line too.如果我抑制 matplotlib 导入,该 exe 也适用于 Windows 命令行。 The issue is clearly caused by matplotlib, but I have no idea how to solve it.这个问题明明是matplotlib引起的,但是我不知道怎么解决。 Can you help me?你能帮助我吗?

Thank you.谢谢你。

Using: Python 3.7.9 Pyinstaller 3.6 Matplotlib 3.2.2使用:Python 3.7.9 Pyinstaller 3.6 Matplotlib 3.2.2

The solution is here: https://github.com/pyinstaller/pyinstaller/issues/4968#issuecomment-662075970解决方法在这里: https://github.com/pyinstaller/pyinstaller/issues/4968#issuecomment-662075970

The issue comes from pyinstaller and not from missing options or environment问题来自 pyinstaller 而不是缺少选项或环境

暂无
暂无

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

相关问题 Python 模块请求在 anaconda 提示符下工作但不在 Windows 10 命令行中工作 - Python module requests working in anaconda prompt but not in windows 10 command line 从 VBA(或命令行)启动 Anaconda 提示 - Launching Anaconda Prompt from VBA (Or Command Line) 从 Windows 命令提示符复制 Anaconda 环境 - Replicating Anaconda Environment From Windows Command Prompt 如何通过在Windows中选择anaconda或Python从命令提示符运行Python文件? - How to run Python file from command prompt by selecting anaconda or Python in windows? 如何将文件.py转换为.exe,从Anaconda Navigator获取Python? (我应该在哪个命令提示符下编写安装代码?) - How to convert file .py to .exe, having Python from Anaconda Navigator? (in which command prompt should I write installation codes?) 程序类被卡住/空闲,并且在Anaconda /命令行提示符中进行第一次调用后不执行其余调用,但在Spyder中有效 - Program class is stuck/idle and does not execute remaining calls after 1st call in Anaconda/Command Line Prompt but works in Spyder Windows 上命令行启动时出现 Anaconda unicode 错误 - Anaconda unicode error on command line startup on Windows 如何在 Windows 命令提示符下运行 python 文件? - How to run a python file in the windows command prompt? Windows 命令提示导入错误:无法导入所需的依赖项:Z2EA9510C37F7F89E4941 - Python Pandas in Windows Command Prompt ImportError: Unable to import required dependencies: numpy (Anaconda) 是否有 Python function 在 Windows 10 命令行提示时自动回答是? - Is there a Python function to automatically answer yes on prompt in Windows 10 Command Line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM