我正在为matplotlib执行示例文件,并在正常退出主窗口时得到以下错误。
Fatal Python error: deallocating None
我只更改了以下几行,因为我想使用PySide2而不是PyQt。
原件:
# Make sure that we are using QT5
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtWidgets
新的:
# Make sure that we are using QT5
matplotlib.use('Qt5Agg')
matplotlib.rc
尝试在Linux上使用Matplotlib,但我一直收到这个错误:
ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running
我在操作系统上使用一个虚拟环境: Linux 18.04LTS。Python版本: 3.6
我已经尝试了许多其他帖子建议的解决方案:
sudo apt-get install tk-dev libpng-dev libffi-dev dv
我在CentOS 7上安装CentOS有问题,我已经安装了所有freetype,libpng-devel。我不知道怎么解决这个问题。
我试着安装yum。它确实起作用了,但是当我导入时,我得到了一个错误。
可选后端扩展
macosx: no [Mac OS-X only]
qt5agg: no [PyQt5 not found]
qt4agg: no [PyQt4 not found]
pyside: no [PySide not found]
我正在使用PyCharm的SciView绘图仪(我认为它是matplotlib后端),但是由于它不支持缩放窗格和其他函数,所以我禁用了它。现在,引发了以下错误:
ValueError: view limit minimum -1.0 is less than 1 and is an invalid Matplotlib date value. This often happens if you pass a non-datetime value to an axis that has datetime units
Traceback (most recent call last):
然后是一个
我有一个github存储库,在这里我开发了一个。
最近,我从PyQt5完全迁移到了PySide2。
今天,我为持续集成添加了Travis-CI,作为Githb存储库的一个挂钩。这意味着,当我推动一些更改时,travis-CI在云中的独立机器中启动我的存储库的构建。
特拉维斯·CI之所以失败,是因为:
ImportError while importing test module '/home/travis/build/SanPen/GridCal/src/tests/test_branch_tolerance.py'. Hint: make sure your test mod
我是一名学生,正在写一个项目。我已经创建了一个程序(这里是SVN:https://mysvn.ru/Ilya_Antonov/antonov_sem_prj的链接)。我使用CMake构建它并生成.sln项目。但在Visual Studio中运行时,会出现一些错误:编译器无法打开文件"drumswindow.h“和"mainwindow.h”(致命错误C1083)。请看一下我的CMakeLists.txt: cmake_minimum_required(VERSION 3.1.0)
project(MusicSimulator VERSION 1.0.0 LANGUAGES
我正在用Qt5编写的GUI开发一个python代码。GUI已经包含了一个2D图。我想在一个新的窗口里打开一个图形来画一些东西。使用matplotlib.pyplot.figure会产生一个错误。下面是制作情节的功能:
def deformed_mesh_3D(model, scale):
x, y = model.nodal_coordinates
z = list()
z_reference = list()
for node in model.nodes:
if node.results.get('w') is None:
我试着利用后盾,但每次我试图策划一些事情时都会出错.这段代码是一个工作示例的简单副本粘贴,它使我注意到这个错误: ImportError:无法加载后端'TkAgg‘,它需要'tk’交互框架,因为'qt5‘目前正在运行。
import backtrader as bt
from datetime import datetime
class firstStrategy(bt.Strategy):
def __init__(self):
self.rsi = bt.indicators.RSI_SMA(self.data.close, period
我正在运行一个脚本来绘制一些数据。但是当我运行它时,它失败了,我在控制台中得到了这个:
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available p
在使用我的python包时,某个函数具有一些交互式的matplotlib内容。在木星笔记本,我总是必须使用神奇的%matplotlib qt切换后端,以使它的工作。然而,这在我看来似乎是显而易见的,但其他试图处理我的包的人--这并不是那么直接。
这就是我到目前为止在我的__init__.py中所拥有的
def run_from_notebook():
return hasattr(__builtins__, '__IPYTHON__')
if run_from_notebook():
# this has no effect
try:
我需要在木星笔记本中用matplotlib创建科学的情节,并在单独的窗口而不是内联中创建它们。我运行了%matplotlib qt并得到了以下错误:ImportError: No module named PyQt4
在互联网上,很多相关的答案都涉及安装PyQt4。为了提供一些背景信息,我使用Anaconda管理Windows机器上的python模块。Anaconda默认在其根环境中安装PyQt5.6.0。将此包降级为PyQt4将解决问题,但是,我的项目中的另一个模块依赖于PyQt5。我想弄清楚如何在PyQt5中使用matplotlib。
根据matpl强有力的,它支持PyQt5后端。我试图在