traitlets.traitlets.TraitError: Could not decode 'C:Users\xcexa2xccxf0xd0xc4xd3xef.jupyter' for unicode trait 'config_dir' of a NotebookApp instance.
解决办法:将下面一段代码保存为py文件,文件名为“python jupyter_nootbook_start.py”,以后运行该文件即可打开jupyter。
1 import os 2 import subprocess 3 4 #base = 'D:\Anaconda' 5 base = 'D:ProgrammingToolpythonAnaAnaconda' 6 jupyter_dir = os.path.join(base,'.jupyter') 7 if not os.path.exists(jupyter_dir): 8 os.mkdir(jupyter_dir) 9 10 dirs = {'JUPYTER_CONFIG_DIR' : jupyter_dir, 'JUPYTER_RUNTIME_DIR' : os.path.join(jupyter_dir,'runtime'),'JUPYTER_DATA_DIR' : os.path.join(jupyter_dir,'data')} 11 12 for k,v in dirs.iteritems(): 13 if not os.path.exists(v): 14 os.mkdir(v) 15 os.environ[k] = v 16 17 ipython_dir = os.path.join(base,'.ipython') 18 19 os.environ['IPYTHONDIR'] = ipython_dir 20 21 subprocess.call(['D:ProgrammingToolpythonAnaAnacondaScriptsjupyter-notebook.exe']) 22