PermissionError: [Errno 13] in python

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

                       

出现该错误,首先尝试以管理员身份运行 cmd.exe 程序,然后关闭所有的与 python 相关的进程。

1. open 打开一个文件夹(目录),而不是文件

这一错误一般发生在使用 open函数对文件打开,进行读写操作时,

PermissionError: [Errno 13] in python
Python: Why am I getting [Errno 13] Permission Denied?

在字符串之前添加r前缀,以表示 raw,以保证不会将路径中出现的nb等字符转换为别的类型。

2. 使用 pip install 安装包时,

PyQt5 pip installation error 13. Permission denied

一般错误提示会给出,PermissionError: [Errno 13] Permission denied: ‘c:\anaconda3\Lib\site-packages\xxxx.pyd’,也即在操作某 xxxx.pyd 文件时发生权限问题。

打开windows的任务管理器(task manager),关闭一切与 python 相关的进程,重新下载安装。

           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

这里写图片描述

猜你喜欢

转载自blog.csdn.net/hftytf/article/details/83542450