spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.32k stars 1.61k forks source link

OPENCV plots making window crashes #15540

Closed adarsh3601 closed 3 years ago

adarsh3601 commented 3 years ago

Description

What steps will reproduce the problem?

-- coding: utf-8 --

""" Created on Fri May 7 17:14:24 2021

@author: Adarsh """

import matplotlib.pyplot as plt import matplotlib.image as mpimg img1 = mpimg.imread('D:\GalMer\Image_Downloader\Montage\P_0_0_0.jpg') img2 = mpimg.imread('D:\GalMer\Image_Downloader\Montage\P_0_0_45.jpg')

plt.figure(1) plt.subplot(211) plt.imshow(img1) plt.subplot(212) plt.imshow(img2) plt.show()

import cv2 import numpy as np

Read First Image

img1 = cv2.imread('GFG.png')

Read Second Image

img2 = cv2.imread('GFG.png')

concatanate image Horizontally

Hori = np.concatenate((img1, img2), axis=1)

concatanate image Vertically

Verti = np.concatenate((img1, img2), axis=0)

cv2.imshow('HORIZONTAL', Hori) cv2.imshow('VERTICAL', Verti)

cv2.waitKey(0) cv2.destroyAllWindows()

Traceback

--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\91766\anaconda3\lib\logging\__init__.py", line 1084, in emit
    stream.write(msg + self.terminator)
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
  File "C:\Users\91766\anaconda3\Scripts\spyder-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\91766\anaconda3\lib\site-packages\spyder\app\start.py", line 213, in main
    mainwindow.main(options, args)
  File "C:\Users\91766\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 2311, in main
    mainwindow = create_window(app, splash, options, args)
  File "C:\Users\91766\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 2207, in create_window
    app.exec_()
  File "C:\Users\91766\anaconda3\lib\site-packages\qtconsole\manager.py", line 27, in poll
    super().poll()
  File "C:\Users\91766\anaconda3\lib\site-packages\jupyter_client\restarter.py", line 113, in poll
    self.kernel_manager.restart_kernel(now=True, newports=newports)
  File "C:\Users\91766\anaconda3\lib\site-packages\jupyter_client\manager.py", line 454, in restart_kernel
    self.start_kernel(**self._launch_args)
  File "C:\Users\91766\anaconda3\lib\site-packages\jupyter_client\manager.py", line 314, in start_kernel
    self.post_start_kernel(**kw)
  File "C:\Users\91766\anaconda3\lib\site-packages\qtconsole\manager.py", line 62, in post_start_kernel
    self.kernel_restarted.emit()
  File "C:\Users\91766\anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\shell.py", line 786, in _handle_kernel_restarted
    super(ShellWidget, self)._handle_kernel_restarted(*args, **kwargs)
  File "C:\Users\91766\anaconda3\lib\site-packages\qtconsole\frontend_widget.py", line 530, in _handle_kernel_restarted
    self.log.warning("kernel restarted")
Message: 'kernel restarted'
Arguments: ()

Versions

Dependencies


# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.19.0 (OK)
jedi =0.17.2                  :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  21.4.0 (OK)
nbconvert >=4.0               :  6.0.7 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
paramiko >=2.4.0              :  2.7.2 (OK)
parso =0.7.0                  :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.7.2 (OK)
pygments >=2.0                :  2.7.2 (OK)
pylint >=1.0                  :  2.6.0 (OK)
pyls >=0.36.2;<1.0.0          :  0.36.2 (OK)
pyls_black >=0.4.6            :  0.4.6 (OK)
pyls_spyder >=0.3.2           :  0.3.2 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.0 (OK)
qtawesome >=1.0.2             :  1.0.2 (OK)
qtconsole >=5.0.3             :  5.0.3 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.8.3                 :  0.9.4 (OK)
setuptools >=39.0.0           :  53.0.0 (OK)
sphinx >=0.6.6                :  3.2.1 (OK)
spyder_kernels >=2.0.1;<2.1.0 :  2.0.1 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3;<2.0.0      :  0.10.3 (OK)
zmq >=17                      :  19.0.2 (OK)

# Optional:
cython >=0.21                 :  0.29.21 (OK)
matplotlib >=2.0.0            :  3.3.2 (OK)
numpy >=1.7                   :  1.19.5 (OK)
pandas >=1.1.1                :  1.1.3 (OK)
scipy >=0.17.0                :  1.5.2 (OK)
sympy >=0.7.3                 :  1.6.2 (OK)
ccordoba12 commented 3 years ago

Hey @adarsh3601, thanks for reporting. This is a duplicate of issue #15356 and it'll be fixed in our next version (5.0.2), to be released soon.