1

在 Mac OSX 10.8.4 上。我通过 ScipySuperpack 安装了 IPython。它似乎安装得很好。

要启动,我被告知ipython notebook --pylab=inline在命令行中输入。

但是我收到以下错误

Traceback (most recent call last):   File "/usr/local/bin/ipython", line 8, in <module>
    load_entry_point('ipython==1.0.0-dev', 'console_scripts', 'ipython')()   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/__init__.py", line 118, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/config/application.py", line 538, in launch_instance
    app.initialize(argv)   File "<string>", line 2, in initialize   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/terminal/ipapp.py", line 309, in initialize
    super(TerminalIPythonApp, self).initialize(argv)   File "<string>", line 2, in initialize   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/core/application.py", line 361, in initialize
    self.parse_command_line(argv)   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/terminal/ipapp.py", line 304, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)   File "<string>", line 2, in parse_command_line   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/config/application.py", line 468, in parse_command_line
    return self.initialize_subcommand(subc, subargv)   File "<string>", line 2, in initialize_subcommand   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/config/application.py", line 400, in initialize_subcommand
    subapp = import_item(subapp)   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/utils/importstring.py", line 42, in import_item
    module = __import__(package, fromlist=[obj])   File "/Library/Python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/IPython/html/notebookapp.py", line 38, in <module>
    from jinja2 import Environment, FileSystemLoader   File "/Library/Python/2.7/site-packages/Jinja2-2.7.1-py2.7.egg/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template   File "/Library/Python/2.7/site-packages/Jinja2-2.7.1-py2.7.egg/jinja2/environment.py", line 13, in <module>
    from jinja2 import nodes   File "/Library/Python/2.7/site-packages/Jinja2-2.7.1-py2.7.egg/jinja2/nodes.py", line 18, in <module>
    from jinja2.utils import Markup   File "/Library/Python/2.7/site-packages/Jinja2-2.7.1-py2.7.egg/jinja2/utils.py", line 520, in <module>
    from markupsafe import Markup, escape, soft_unicode ImportError: No module named markupsafe

关于我哪里出错的建议?

4

3 回答 3

1

我新安装的 ubuntu 14.04 也有同样的问题

似乎 pip install jinja2 出错了,我的解决方案是

pip uninstall jinja2
sudo apt-get install python-jinja2
于 2014-11-30T01:59:58.900 回答
1

通过安装 jupyter 后我遇到了这个问题pip install jupyter对我有用的解决方案是直接从https://pypi.python.org/pypi/MarkupSafe下载 markupsafe tarball并通过sudo python setup.py install.

于 2016-03-29T06:10:23.797 回答
0

使用 ScipySuperpack 安装的 pip 版本,执行

pip install ipython[all]

这应该修复所有依赖项。

于 2013-08-24T02:55:10.227 回答