- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近按照此处的说明安装了 ipython:http://ardiyu07.blogspot.com/2012/04/ipython-012-installation-in-cygwin.html .
当我跑 'ipython --pylab'
我收到以下错误消息。我在谷歌上搜索并找到了有关此错误的帖子,但在不同的上下文中。当我使用 --pylab 参数启动 ipython 时会发生我的情况。我知道这与 matplotlib gui 交互有关,但不确定到底是什么。我很感激指导。
$ ipython --pylab
Python 2.7.3 (default, Dec 18 2012, 13:50:09)
Type "copyright", "credits" or "license" for more information.
IPython 0.13.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
Welcome to pylab, a matplotlib-based Python environment [backend: TkAgg].
For more information, type 'help(pylab)'.
[TerminalIPythonApp] GUI event loop or pylab initialization failed
---------------------------------------------------------------------------
TclError Traceback (most recent call last)
/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in enable_pylab(self, gui, import_all)
2780 # Now we must activate the gui pylab wants to use, and fix %run to take
2781 # plot updates into account
-> 2782 self.enable_gui(gui)
2783 self.magics_manager.registry['ExecutionMagics'].default_runner = \
2784 mpl_runner(self.safe_execfile)
/usr/lib/python2.7/site-packages/IPython/lib/inputhook.pyc in enable_gui(gui, app)
526 e = "Invalid GUI request %r, valid ones are:%s" % (gui, guis.keys())
527 raise ValueError(e)
--> 528 return gui_hook(app)
529
/usr/lib/python2.7/site-packages/IPython/lib/inputhook.pyc in enable_tk(self, app)
322 if app is None:
323 import Tkinter
--> 324 app = Tkinter.Tk()
325 app.withdraw()
326 self._apps[GUI_TK] = app
/usr/lib/python2.7/lib-tk/Tkinter.pyc in __init__(self, screenName, baseName, className, useTk, sync, use)
1683 baseName = baseName + ext
1684 interactive = 0
-> 1685 self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
1686 if useTk:
1687 self._loadtk()
TclError: no display name and no $DISPLAY environment variable
最佳答案
类型 startxwin
进入 cygwin 终端(您将需要 cygwin setup.exe 中可用的 X11 库)然后您可以运行 ipython --pylab
从新的终端窗口和类似 plot(range(10))
的命令这将打开一个新窗口,但您还需要调用 plt.draw()
为了使绘图与原生 pylab 不同,与原生 pylab 相比,cygwin 中绘图的窗口控制也很差。
在此过程中我不需要编辑任何安装文件,您可能需要“pip uninstall matplotlib”并重新安装,直到您通过 cygwin setup.exe 安装了所需的库(tkinter 和我相信 X11-devel 库是必需的) .
通过 ez_setup.py 获取 setuptools
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
easy_install pip
pip install numpy
pip install ipython
pip install matplotlib
关于matplotlib - cygwin : TclError: no display name and no $DISPLAY environment variable 上的 ipython --pylab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15601695/
我想在 32 位 Windows 上获取路径 system32 路径,在 64 位 Windows 上获取路径 SysWOW64。 Environment.GetFolderPath(Environm
我可以在 environment.yml 中设置环境变量吗? conda 中的文件环境? conda 让我 save environment variables in environments通过 e
我一直在尝试大部分 Enviroment.SpecialFolder 枚举,但我认为没有任何方法可以通过枚举。使用 string.Substring() 方法给我带来了最大的收获。 我尝试只获取实际安
当我在 .ios 项目的 appDelegate 中使用 Environment.GetFolderPath(Environment.SpecialFolder.Personal) 时,我得到一个路径
我找到了 this project在做一些研究的同时。我注意到 Docker Compose 示例文件中的这一行: environment: &environment 所以我想知道它实际上意味着什么?
在 python/flask/gunicorn/heroku 堆栈上,我需要根据另一个 env 变量的内容设置一个环境变量。 作为背景,我在 heroku 上运行了一个 python/Flask 应用
我正在尝试使用 angularfire @angular/[email protected] 构建 Angular 15 。但我遇到了这个错误 ✔ Downloading configuration
我在我的一位客户的计算机上遇到了一个非常奇怪的行为,我找不到任何线索来解释为什么会这样:当应用程序调用 Environment.GetFolderPath(Environment.SpecialFol
我遇到了以下方法: Environment.getDataDirectory() : /data 和 getFilesDir() : /data/data/package/files 一种方法使用环境
我在 rails 中有一个迁移,它执行以下操作: class AddMissingIndexes :evid, :length => { :evid => 255 } end end 但是,在对
所以我对 MS Stack Development 世界相当陌生,面临着本地开发环境与服务器环境不同的问题(我认为它们是一样的,但我错了)。 我的设置是使用 Visual Studio 2012(II
我有一个只包含 exe 文件(没有源代码)的 hello 工具。 你好工具结构: bin helloBin.exe helloRoot.exe conanfile.py conanfile.py
我是 R 的新用户,我尝试了以下代码。它给出了一个错误。任何人都可以帮忙吗?代码是: library(ggplot2) data(diamonds) qplot(price, data=diamond
我正在使用以下方法获取 Windows 7 中“我的文档”文件夹的路径并遍历其目录: Dim diri As New DirectoryInfo(Environment.GetFolderPath(E
我试图通过更改其环境变量来修改 Linux 上 JetBrains Rider 中 .NET 项目的设置配置文件。但是,当我点击文件夹图标时,我无法点击添加、删除或修改任何环境变量。 我注意到在 Ri
这个问题已经有答案了: How to add package to conda environment without pip (5 个回答) 已关闭 1 年前。 我在没有连接到互联网的计算机上安装了
我开发了一个 Controller 来使用 JSON 响应 AJAX 请求: class PeopleController extends Controller { public function l
我有一个 asp.net mvc3 应用程序。现在我想将用户数据保存在 C:\Users{AppPoolUserAccount}\AppData\Roaming\MyProgramm... 在第一次调
#include #include #include extern char *environ[]; int main(int argc, char *argv[]) { int ind
我在将 json 文件导入 typescript 时遇到问题。我已经按照惯例配置了tsconfig.json,但是在environment.ts文件中还是不行,但是在environment.prod.
我是一名优秀的程序员,十分优秀!