简体   繁体   English

Debian上的Python Matplotlib show()

[英]Python Matplotlib show() on Debian

I am running Debian 8.7 (Jessie) on a development laptop. 我正在开发笔记本电脑上运行Debian 8.7(Jessie)。 I am just getting into Python development for some machine learning projects I am working on. 我刚刚开始从事我正在从事的一些机器学习项目的Python开发。 I also have Python installed on a my main Mac OSX macbook as well. 我的主要Mac OSX MacBook上也安装了Python。

While working on some examples, the OSX install, when using plt.show() (from Matplotlib/pyplot), a window will pop up with the plot. 在处理某些示例时,在使用plt.show()(来自Matplotlib / pyplot)时,将安装OSX,并弹出一个带有绘图的窗口。 On the Debian laptop, however, I get nothing back. 但是,在Debian笔记本电脑上,我什么也没回来。 No errors, nothing. 没有错误,没事。 I changed the plt.show() command to just save the figure out to a file and that works. 我更改了plt.show()命令,仅将图形保存到文件即可。

I read some forums and posts that talk about installing ImageMagick and other tools. 我阅读了一些论坛和文章,这些文章讨论有关安装ImageMagick和其他工具的信息。 I have tried that, but that didn't seem to work. 我已经尝试过了,但是那似乎没有用。 Another option was to change the "backends". 另一种选择是更改“后端”。 I also read something about using " eog " instead of the xv or display provided by the base OS. 我还阅读了有关使用“ eog ”而不是基本操作系统提供的xv或显示的内容。 The post is located here: 该帖子位于这里:

matplotlib does not show my drawings although I call pyplot.show() 尽管我调用pyplot.show(),但matplotlib不会显示我的绘图

I went through this process, but that doesn't seem to work either. 我经历了这个过程,但这似乎也不起作用。 I'm wondering if this has something to with the fact that I had to download, configure and make the Python 3.6.1 version I am running on the Linux side. 我想知道这是否与我必须在Linux端运行的Python 3.6.1版本进行下载,配置和制作有关。 I'm still a little new at Python, so I'm unsure how to solve this. 我对Python还是有点陌生​​,所以不确定如何解决这个问题。

Info: 信息:

OS: Debian 8.7 (Debian) Python Version: 3.6.1 Packages Installed: pandas, matplotlib, bokeh, scikit-learn (and all the other major data science and machine learning libraries/packages). 操作系统:Debian 8.7(Debian)Python版本:3.6.1已安装的软件包:pandas,matplotlib,bokeh,scikit-learn(以及所有其他主要的数据科学和机器学习库/软件包)。 I used pip3.6 to install these, since the default python install is 2.7.9 on the OS. 我使用pip3.6进行了安装,因为在操作系统上默认的python安装为2.7.9。

Please let me know if there is more information needed. 请让我知道是否需要更多信息。 Thanks! 谢谢!

Have you tried checking whether you're using python 3.6 instead of the 2.7? 您是否尝试过检查是否使用python 3.6而不是2.7? Try checking your bashrc. 尝试检查您的bashrc。

I had a similar problem before with seaborn because i was using 2.7 at first and changed to 3.6. 在seaborn之前,我也遇到过类似的问题,因为我最初使用的是2.7,后来改为3.6。 I used spyder now so my default python and projects will not get confused. 我现在使用了spyder,因此不会混淆我的默认python和项目。 Or you could try Python Virtual Environment. 或者您可以尝试使用Python虚拟环境。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM