IOError: [Errno 13] Permission denied: ‘D:/VMware/VMware Workstation/vmwarebase.dll‘ 的解决

今天准备在windows 10 上 安装MAC的虚拟机,再执行unlocker.exe时,总是遇到如下错误:

 在网上找到了两个解决方法,一个是说python的版本问题,一个说是python的路径分隔符问题,结果两个解决方法都不行。

于是找到了一个关于文件读取的说明:

``r'' Open text file for reading. The stream is positioned at the beginning of the file.

``r+'' Open for reading and writing. The stream is positioned at the beginning of the file.

``w'' Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.

``w+'' Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file.

``a'' Open for writing. The file is created if it does not exist. The stream is positioned at the end of the file. Subsequent writes to the file will always end up at the then current end of file, irrespective of any intervening fseek(3) or similar.

``a+'' Open for reading and writing. The file is created if it does not exist. The stream is positioned at the end of the file. Subse- quent writes to the file will always end up at the then current end of file, irrespective of any intervening fseek(3) or similar.

From python documentation - 7. Input and Output — Python 2.7.18 documentation

On Windows, 'b' appended to the mode opens the file in binary mode, so there are also modes like 'rb', 'wb', and 'r+b'. Python on Windows makes a distinction between text and binary files; the end-of-line characters in text files are automatically altered slightly when data is read or written. This behind-the-scenes modification to file data is fine for ASCII text files, but it’ll corrupt binary data like that in JPEG or EXE files. Be very careful to use binary mode when reading and writing such files. On Unix, it doesn’t hurt to append a 'b' to the mode, so you can use it platform-independently for all binary files.

找到unlocker.py的脚本中读取文件的代码:

发现这里使用的是r+b,把r+b改为r,再执行python unlocker.py,就可以了。

 

由于作者本人的github上删除了unlocker的所有内容,最后,从https://github.com/BDisp/unlocker 找到了最新的版本,没有发现脚本有类似问题。直接执行批处理文件,就可以了。

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
根据您提供的引用内容,"IOError: [Errno 13] Permission denied" 错误通常表示在尝试访问或操作文件或目录时,当前用户没有足够的权限。这可能是由于文件或目录的所有者或权限设置不正确导致的。 要解决这个问题,您可以尝试以下几种方法: 1. 检查文件或目录的权限:确保您有足够的权限来访问或操作该文件或目录。您可以使用命令`ls -l`(在Linux或Mac上)或`dir`(在Windows上)来查看文件或目录的权限设置。 2. 更改文件或目录的权限:如果您是文件或目录的所有者,您可以使用`chmod`命令(在Linux或Mac上)或`icacls`命令(在Windows上)来更改文件或目录的权限。例如,在Linux或Mac上,可以使用以下命令将文件的权限更改为可读写: ```shell chmod +rw filename ``` 3. 以管理员身份运行程序:如果您是在Windows上运行程序并且遇到权限问题,您可以尝试以管理员身份运行程序。右键单击程序图标,然后选择以管理员身份运行”。 4. 检查文件或目录的所有者:确保文件或目录的所有者是当前用户或具有足够权限的用户。您可以使用`chown`命令(在Linux或Mac上)或在Windows上使用文件属性对话框来更改文件或目录的所有者。 请注意,具体的解决方法可能因操作系统和具体情况而异。如果以上方法都无法解决问题,您可能需要进一步调查错误的原因或寻求更专业的帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值