37,720
社区成员
发帖
与我相关
我的任务
分享
[C 01:27:32.831 NotebookApp] Bad config encountered during initialization:
[C 01:27:32.832 NotebookApp] Could not decode 'C:\\Users\\\xce\xf7\xb9\xcf\\.jupyter' for unicode trait 'config_dir' of a NotebookApp instance.
import os
import subprocess
#base = 'C:\\data'
base = 'C:\Python27'
jupyter_dir = os.path.join(base,'.jupyter')
if not os.path.exists(jupyter_dir):
os.mkdir(jupyter_dir)
dirs = {'JUPYTER_CONFIG_DIR' : jupyter_dir, 'JUPYTER_RUNTIME_DIR' : os.path.join(jupyter_dir,'runtime'),'JUPYTER_DATA_DIR' : os.path.join(jupyter_dir,'data')}
for k,v in dirs.iteritems():
if not os.path.exists(v):
os.mkdir(v)
os.environ[k] = v
ipython_dir = os.path.join(base,'.ipython')
os.environ['IPYTHONDIR'] = ipython_dir
subprocess.call(['C:\\Python27\\Scripts\\jupyter-notebook.exe'])