使用ScipySuperpack的IPython Notebook:缺少markupsafe依赖项

时间:2013-08-23 21:27:26

标签: python ipython ipython-notebook

在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

关于我哪里出错的建议?

3 个答案:

答案 0 :(得分:1)

我在新安装的ubuntu 14.04中遇到同样的问题

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

pip uninstall jinja2
sudo apt-get install python-jinja2

答案 1 :(得分:1)

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

答案 2 :(得分:0)

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

pip install ipython[all]

这应该修复所有依赖项。