ubuntu配置jupyter
程序员文章站
2022-05-29 07:58:40
...
ubuntu安装Anaconda3之后会自动安装jupyter,Anaconda下载地址推荐清华大学的下载地址,具体安装教程请看这里。
进入Anaconda虚拟环境后,cd到想要打开文件()的目录,输入
jupyter notebook
然后会报一大堆错误,如下:
Traceback (most recent call last):
File "/home/user07/anaconda3/lib/python3.6/site-packages/notebook/base/handlers.py", line 516, in wrapper
result = yield gen.maybe_future(method(self, *args, **kwargs))
File "/home/user07/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/home/user07/anaconda3/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "<string>", line 4, in raise_exc_info
File "/home/user07/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 307, in wrapper
yielded = next(result)
File "/home/user07/anaconda3/lib/python3.6/site-packages/notebook/services/contents/handlers.py", line 124, in get
path=path, type=type, format=format, content=content,
File "/home/user07/anaconda3/lib/python3.6/site-packages/notebook/services/contents/filemanager.py", line 384, in get
model = self._notebook_model(path, content=content)
File "/home/user07/anaconda3/lib/python3.6/site-packages/notebook/services/contents/filemanager.py", line 344, in _notebook_model
self.mark_trusted_cells(nb, path)
File "/home/user07/anaconda3/lib/python3.6/site-packages/notebook/services/contents/manager.py", line 456, in mark_trusted_cells
trusted = self.notary.check_signature(nb)
File "/home/user07/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "/home/user07/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "/home/user07/anaconda3/lib/python3.6/site-packages/notebook/services/contents/manager.py", line 58, in _notary_default
return sign.NotebookNotary(parent=self)
File "/home/user07/anaconda3/lib/python3.6/site-packages/nbformat/sign.py", line 392, in __init__
self.store = self.store_factory()
File "/home/user07/anaconda3/lib/python3.6/site-packages/nbformat/sign.py", line 340, in factory
return SQLiteSignatureStore(self.db_file)
File "/home/user07/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "/home/user07/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "/home/user07/anaconda3/lib/python3.6/site-packages/nbformat/sign.py", line 351, in _db_file_default
if not self.data_dir:
File "/home/user07/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "/home/user07/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "/home/user07/anaconda3/lib/python3.6/site-packages/nbformat/sign.py", line 328, in _data_dir_default
return app.data_dir
File "/home/user07/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "/home/user07/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "/home/user07/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 93, in _data_dir_default
ensure_dir_exists(d, mode=0o700)
File "/home/user07/anaconda3/lib/python3.6/site-packages/ipython_genutils/path.py", line 167, in ensure_dir_exists
os.makedirs(path, mode=mode)
File "/home/user07/anaconda3/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/user07/.local/share/jupyter'
主要原因就是最后一句,anaconda3中os.py有一个在文件夹'/home/user07/.local/share/jupyter'下的mkdir操作,而当前用户没有权限,所以需要:
sudo chmod 777 ~/.local/share/
再次输入:
jupyter notebook
大功告成!
上一篇: Laravel-admin 展示关联模型数据的问题
下一篇: java同步锁的实现
推荐阅读
-
nginx配置ssl
-
ubuntu停源码方式安装php5.4.13并且配置nginx
-
detectron2训练自己的数据实现目标检测和关键点检测(一) ubuntu18.04安装测试detectron2
-
PHP读取四种配置文件(php,ini,yaml,xml)的例子
-
Python使用自带的ConfigParser模块读写ini配置文件
-
Ubuntu 16.04 安装有道词典
-
Win7下MongoDB安装初始配置
-
ubuntu 13.04 安装mysql数据库教程
-
CentOS-6.5下MariaDB-10基于XtraBackup备份工具的原理及配置详解
-
学习php 一步一步学习PHP1 php开发环境配置