pycharm Python error: PermissionError: [Errno 13] Permission denied:
今天用pycharm调试代码的时候,遇见了PermissionError: [Errno 13] Permission denied:, 但是我实际上是有权限的,查看资料,发现原来是 debug 配置i里脚本的地方,填写了一个文件夹的路径,不是一个文件,就报了这个错:
C:\Users\[username]\AppData\Local\Programs\Python\Python36\python.exe "C:\Program Files\JetBrains\PyCharm 2018.1\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 64355 --file D:/code/movie
Error in sitecustomize; set PYTHONVERBOSE for traceback:
NameError: name 'modules_list' is not defined
pydev debugger: process 10736 is connecting
Connected to pydev debugger (build 181.4203.547)
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2018.1\helpers\pydev\pydevd.py", line 1664, in <module>
main()
File "C:\Program Files\JetBrains\PyCharm 2018.1\helpers\pydev\pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\JetBrains\PyCharm 2018.1\helpers\pydev\pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2018.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile
stream = tokenize.open(file) # @UndefinedVariable
File "C:\Users\[username]\AppData\Local\Programs\Python\Python36\lib\tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
PermissionError: [Errno 13] Permission denied: 'D:/code/movie'
这里一定要填写文件的路径,比如:
这样就OK了