Jupyter笔记本不起作用。它显示了CalledProcessError和UnicodeDecodeError

时间:2017-09-08 08:52:28

标签: python keras anaconda jupyter-notebook theano

我用anacoda安装theano和keras后,jupyter笔记本无法正常工作。 错误如下。

    (d:\Anaconda2) C:\Users\win>jupyter notebook
    [W 21:34:57.832 NotebookApp] Unrecognized JSON config file version, assuming ver
    sion 1
    Traceback (most recent call last):
    File "d:\Anaconda2\Scripts\jupyter-notebook-script.py", line 5, in <module>
    sys.exit(notebook.notebookapp.main())
    File "d:\Anaconda2\lib\site-packages\jupyter_core\application.py", line 267, i
    n launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
    File "d:\Anaconda2\lib\site-packages\traitlets\config\application.py", line 59
    5, in launch_instance
    app.initialize(argv)
    File "<decorator-gen-7>", line 2, in initialize
    File "d:\Anaconda2\lib\site-packages\traitlets\config\application.py", line 74
    , in catch_config_error
    return method(app, *args, **kwargs)
    File "d:\Anaconda2\lib\site-packages\notebook\notebookapp.py", line 1069, in i
    nitialize
    self.init_configurables()
    File "d:\Anaconda2\lib\site-packages\notebook\notebookapp.py", line 837, in in
    it_configurables
    parent=self,
    File "d:\Anaconda2\lib\site-packages\nb_conda_kernels\manager.py", line 19, in
    __init__
    specs = self.find_kernel_specs() or {}
    File "d:\Anaconda2\lib\site-packages\nb_conda_kernels\manager.py", line 129, i
    n find_kernel_specs
    self.conda_info = self._conda_info()
    File "d:\Anaconda2\lib\site-packages\nb_conda_kernels\manager.py", line 29, in
    _conda_info
    p = subprocess.check_output(["conda", "info", "--json"]
    File "d:\Anaconda2\lib\subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
    subprocess.CalledProcessError: Command '['conda', 'info', '--json']' returned no
    n-zero exit status 1

根据错误提示,我使用命令conda info --json错误显示UnicodeDecodeError。

    (d:\Anaconda2) C:\Users\win>conda info --json
    {
    "channels": [
    "https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64",
    "https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarch",
    "https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64",
    "https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch",
    "https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64",
    "https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch",
    "https://repo.continuum.io/pkgs/free/win-64",
    "https://repo.continuum.io/pkgs/free/noarch",
    "https://repo.continuum.io/pkgs/r/win-64",
    "https://repo.continuum.io/pkgs/r/noarch",
    "https://repo.continuum.io/pkgs/pro/win-64",
    "https://repo.continuum.io/pkgs/pro/noarch",
    "https://repo.continuum.io/pkgs/msys2/win-64",
    "https://repo.continuum.io/pkgs/msys2/noarch"
    ],
    "conda_build_version": "1.21.2",
    "conda_env_version": "4.3.25",
    "conda_location": "d:\\Anaconda2\\lib\\site-packages\\conda",
    "conda_prefix": "d:\\Anaconda2",
    "conda_private": false,
    "conda_version": "4.3.25",
    "default_prefix": "d:\\Anaconda2",
    "env_vars": {
    "CIO_TEST": "<not set>",
    "CONDA_DEFAULT_ENV": "d:\\Anaconda2",
    "CONDA_ENVS_PATH": "<not set>",
    "PATH": {
    "error": "Traceback (most recent call last):\n  File \"d:\\Anaconda2\\lib\\sit
    e-packages\\conda\\exceptions.py\", line 640, in conda_exception_handler\n    re
    turn_value = func(*args, **kwargs)\n  File \"d:\\Anaconda2\\lib\\site-packages\\
    conda\\cli\\main.py\", line 140, in _main\n    exit_code = args.func(args, p)\n
    File \"d:\\Anaconda2\\lib\\site-packages\\conda\\cli\\main_info.py\", line 371,
    in execute\n    stdout_json(info_dict)\n  File \"d:\\Anaconda2\\lib\\site-packa
    ges\\conda\\cli\\common.py\", line 586, in stdout_json\n    json.dump(d, sys.std
    out, indent=2, sort_keys=True, cls=EntityEncoder)\n  File \"d:\\Anaconda2\\lib\\
    json\\__init__.py\", line 189, in dump\n    for chunk in iterable:\n  File \"d:\
    \Anaconda2\\lib\\json\\encoder.py\", line 434, in _iterencode\n    for chunk in
    _iterencode_dict(o, _current_indent_level):\n  File \"d:\\Anaconda2\\lib\\json\\
    encoder.py\", line 408, in _iterencode_dict\n    for chunk in chunks:\n  File \"
    d:\\Anaconda2\\lib\\json\\encoder.py\", line 390, in _iterencode_dict\n    yield
    _encoder(value)\nUnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in pos
    ition 453: invalid continuation byte\n"
    }

    (d:\Anaconda2) C:\Users\win>

某些计算机环境信息:

操作系统:Windows 7 Ultimate 64bit
Anacoda版本:Anaconda2-4.1.0-Windows-x86_64
Python版本:Python 2.7
Theano版本:Theano 0.9
Keras版本:Keras 1.2

我该如何解决这个错误?

0 个答案:

没有答案