【问题标题】:Pyinstaller PermissionError: [Errno 1] Operation not permitted: '/Users/user_name/dist/Pyinstaller PermissionError: [Errno 1] Operation not allowed: '/Users/user_name/dist/
【发布时间】:2020-07-10 20:33:16
【问题描述】:

每次我在终端运行 pyinstaller 时都会出现以下错误:

PermissionError: [Errno 1] Operation not allowed: '/Users/my_username/dist/

对解决方案有什么想法吗?

【问题讨论】:

    标签: python-3.x pyinstaller


    【解决方案1】:

    我可以通过在再次运行 Pyinstaller 之前手动删除目标目录中的所有文件来解决这个问题。试试看吧。

    【讨论】:

    • 我有同样的问题,但只有当我将二进制文件添加到我的设置时。对我来说这似乎是一个错误。
    【解决方案2】:

    pyinstaller 可能正在尝试将文件写入您没有写入权限的目录/Users/my_username/dist。 您可以使用超级用户权限(即sudo)重试,也可以尝试使用brew 之类的方法。

    【讨论】:

    • 不走运:(还有其他想法吗?
    • 你能检查一下有问题的方向的权限吗?
    • 我该怎么做?对不起,我是新人
    • 在终端中运行ls -l <the path that comes in the error message>
    【解决方案3】:

    我通过更改创建 DIST 和 BUILD 文件夹的目录的属性取得了成功。

    在 Finder 中找到并选择目录并打开其属性窗口 (CMD + I) 单击向下箭头打开共享和权限面板 单击挂锁并输入您的计算机密码以进行更改 单击所有人,然后从下拉列表中选择读取和写入 点击小齿轮并选择应用到封闭项目

    删除 DIST 和 BUILD 文件夹,然后重试

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-08
      • 1970-01-01
      • 2022-06-23
      • 1970-01-01
      • 2014-07-18
      • 2017-12-23
      • 2016-01-05
      • 2017-01-28
      相关资源
      最近更新 更多