当前位置:网站首页>Sublime text in CONDA environment plt Show cannot pop up the problem of displaying pictures

Sublime text in CONDA environment plt Show cannot pop up the problem of displaying pictures

2022-07-06 08:32:00 MAR-Sky

stay sublilme text(ST) Enter the following simple program , But there is no pop-up picture

Determine the work completed :

  1. Used The library is already installed To the corresponding environment
  2. Use conda Of ptython Setting and starting the environment , Reference resources :https://blog.csdn.net/weixin_43794311/article/details/124642874
  3. Good configuration conda Of python Compilation conditions in the environment
import matplotlib.pyplot as plt
from PIL import Image

img = Image.open('1.jpg')#.convert('1')

plt.figure("beauty")
plt.imshow(img,)
plt.axis('off')
plt.show()

Reference resources :https://www.zhihu.com/question/20539058/answer/1507424142
In the past, I didn't spend much time ST Use plt.show() display picture , It is found that there is a problem in the third step , Solve the problem through the following settings
 Insert picture description here
Modify in the opened configuration file , Note that there should be a comma after each command when modifying , Otherwise there will be problems

 "run_through_shell": true,  

 Insert picture description here

原网站

版权声明
本文为[MAR-Sky]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060827242460.html