conda activate gluon提示需要初始化


#1

windows 10 中利用anaconda(自带python3.7版本)安装了vscode,在vscode终端中运行完第三步,第四步是conda activate gluon,但是提示要初始化conda init,后来按照提示也输入了一些命令,感觉没有成功。最后重新启动anaconda,又重新打开vscode,再次运行conda activate gluon就显示成功了。调用jupyter notebook,进入“线性回归的从零实现”一节,运行第一段代码提示出错,运行结果如下,或如图。请问各位老师报错的是什么?和我的python版本有关系吗?因为gluon的环境中要求的python3.6,这个问题不知道应该怎么解决,谢谢。


OSError Traceback (most recent call last)
in
----> 1 get_ipython().run_line_magic(‘matplotlib’, ‘inline’)
2 from IPython import display
3 from matplotlib import pyplot as plt
4 from mxnet import autograd, nd
5 import random

D:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2312 kwargs[‘local_ns’] = sys._getframe(stack_depth).f_locals
2313 with self.builtin_trap:
-> 2314 result = fn(*args, **kwargs)
2315 return result
2316

<D:\Anaconda3\lib\site-packages\decorator.py:decorator-gen-109> in matplotlib(self, line)

D:\Anaconda3\lib\site-packages\IPython\core\magic.py in (f, *a, **k)
185 # but it’s overkill for just that one bit of state.
186 def magic_deco(arg):
–> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

D:\Anaconda3\lib\site-packages\IPython\core\magics\pylab.py in matplotlib(self, line)
97 print(“Available matplotlib backends: %s” % backends_list)
98 else:
—> 99 gui, backend = self.shell.enable_matplotlib(args.gui.lower() if isinstance(args.gui, str) else args.gui)
100 self._show_matplotlib_backend(args.gui, backend)
101

D:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in enable_matplotlib(self, gui)
3400 “”"
3401 from IPython.core import pylabtools as pt
-> 3402 gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select)
3403
3404 if gui != ‘inline’:

D:\Anaconda3\lib\site-packages\IPython\core\pylabtools.py in find_gui_and_backend(gui, gui_select)
274 “”"
275
–> 276 import matplotlib
277
278 if gui and gui != ‘auto’:

D:\Anaconda3\lib\site-packages\matplotlib_init_.py in
136 # cbook must import matplotlib only within function
137 # definitions, so it is safe to import from it here.
–> 138 from . import cbook, rcsetup
139 from matplotlib.cbook import (
140 MatplotlibDeprecationWarning, dedent, get_label, sanitize_sequence)

D:\Anaconda3\lib\site-packages\matplotlib\cbook_init_.py in
29 from weakref import WeakMethod
30
—> 31 import numpy as np
32
33 import matplotlib

D:\Anaconda3\lib\site-packages\numpy_init_.py in
143 from .core import *
144 from . import compat
–> 145 from . import lib
146 from .lib import *
147 from . import linalg

D:\Anaconda3\lib\site-packages\numpy\lib_init_.py in
22 from .utils import *
23 from .arraysetops import *
—> 24 from .npyio import *
25 from .financial import *
26 from .arrayterator import Arrayterator

D:\Anaconda3\lib\site-packages\numpy\lib\npyio.py in
11
12 import numpy as np
—> 13 from . import format
14 from ._datasource import DataSource
15 from numpy.core import overrides

D:\Anaconda3\lib\importlib_bootstrap.py in find_and_load(name, import)

D:\Anaconda3\lib\importlib_bootstrap.py in find_and_load_unlocked(name, import)

D:\Anaconda3\lib\importlib_bootstrap.py in _load_unlocked(spec)

D:\Anaconda3\lib\importlib_bootstrap_external.py in exec_module(self, module)

D:\Anaconda3\lib\importlib_bootstrap_external.py in get_code(self, fullname)

D:\Anaconda3\lib\importlib_bootstrap_external.py in get_data(self, path)

OSError: [Errno 9] Bad file descriptor


#2

补充一些信息,在vscode中选择python3.6 (gluon)这项时,右下角提示jupyter kernel不能启动。如图所示
Capture Capture1


#3

请各位老师和大神帮忙呀