繁体   English   中英

Errno 13许可被拒绝。 在jupyter笔记本中,UBUNTU

[英]Errno 13 Permission denied. in jupyter notebook, UBUNTU

我新使用了“ UBUNTU in windows”,并在UBUNTU中打开了jupyter笔记本,制作了新的python3文件,并尝试加载名为“ Elliptic_main.py”的文件。 但是,以下代码

%load Elliptic_main.py

给出错误信息

---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
<ipython-input-1-69cbacf526f9> in <module>()
----> 1 get_ipython().run_line_magic('load', 'Elliptic_main.py')

~/.local/lib/python3.6/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
   2129                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2130             with self.builtin_trap:
-> 2131                 result = fn(*args,**kwargs)
   2132             return result
   2133 

<decorator-gen-47> in load(self, arg_s)

~/.local/lib/python3.6/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    185     # but it's overkill for just that one bit of state.
    186     def magic_deco(arg):
--> 187         call = lambda f, *a, **k: f(*a, **k)
    188 
    189         if callable(arg):

~/.local/lib/python3.6/site-packages/IPython/core/magics/code.py in load(self, arg_s)
    333         search_ns = 'n' in opts
    334 
--> 335         contents = self.shell.find_user_code(args, search_ns=search_ns)
    336 
    337         if 's' in opts:

~/.local/lib/python3.6/site-packages/IPython/core/interactiveshell.py in find_user_code(self, target, raw, py_only, skip_encoding_cookie, search_ns)
   3263             if os.path.isfile(tgt):                        # Read file
   3264                 try :
-> 3265                     return openpy.read_py_file(tgt, skip_encoding_cookie=skip_encoding_cookie)
   3266                 except UnicodeDecodeError :
   3267                     if not py_only :

~/.local/lib/python3.6/site-packages/IPython/utils/openpy.py in read_py_file(filename, skip_encoding_cookie)
     74     A unicode string containing the contents of the file.
     75     """
---> 76     with open(filename) as f:   # the open function defined in this module.
     77         if skip_encoding_cookie:
     78             return "".join(strip_encoding_cookie(f))

~/anaconda3/lib/python3.6/tokenize.py in open(filename)
    450     detect_encoding().
    451     """
--> 452     buffer = _builtin_open(filename, 'rb')
    453     try:
    454         encoding, lines = detect_encoding(buffer.readline)

PermissionError: [Errno 13] Permission denied: 'Elliptic_main.py'

我认为这是UBUNTU的问题,但不确定。 有人有同样的问题吗? 谢谢你的帮助


打字

ls -l Elliptic_main.py

给出以下消息:

---------- 1 sungha sungha 1418 Sep 14 13:54 Elliptic_main.py

这是我的用户名。

ls输出

---------- 1 sungha sungha 1418 Sep 14 13:54 Elliptic_main.py

注意

----------

显示设置了哪些权限的部分( 有关更多详细信息,请参见此Wiki中的示例 )在您的情况下,您对该文件没有任何权限,这就是为什么您看到Permission error

尝试

chmod 600 # in case sungha is your username
chmod 666 # otherwise

通过在终端中键入man chmod来检查chmodman chmod页,以获取有关两者之间的区别的更多详细信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM