jupyter安装出现问题:安装后无法打开

jupyter安装出现问题:安装后无法打开

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

 

posted @ 2019-11-10 14:15  迪迦奥特曼1  阅读(363)  评论(0编辑  收藏  举报