标签:conda call ESS sts expand ror decode head cal
traitlets.traitlets.TraitError: Could not decode ‘C:\Users\\xce\xa2\xcc\xf0\xd0\xc4\xd3\xef\.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:\ProgrammingTool\python\Ana\Anaconda‘ 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:\ProgrammingTool\python\Ana\Anaconda\Scripts\jupyter-notebook.exe‘]) 22 ?
标签:conda call ESS sts expand ror decode head cal
原文地址:https://www.cnblogs.com/zyh19980816/p/11942860.html