【问题标题】:Python - error: could not create 'treetagger.egg-info': Permission deniedPython - 错误:无法创建“treetagger.egg-info”:权限被拒绝
【发布时间】:2017-10-09 11:19:32
【问题描述】:

我尝试使用以下命令安装 python 模块(treetager-python):

python3 setup.py install

尝试此操作时,我收到错误:

running install
running bdist_egg
running egg_info
creating treetagger.egg-info
error: could not create 'treetagger.egg-info': Permission denied

我读到了使用标志--user,但这根本不起作用:

python3 setup.py install --user
running install
error: can't combine user with prefix, exec_prefix/home, or install_(plat)base

我知道使用sudo 可能会解决这个问题,但我不喜欢以root 权限执行第3 方文件/代码。

那么有什么方法可以在不使用'sudo'的情况下解决这个问题?

我在 Mac OS 上尝试过,如果需要任何其他信息,请告诉我。

提前致谢!

解决方案: 因此,正如答案所暗示的那样,问题是源文件夹中的权限问题。当我下载这个文件所有者被设置为“root”时,使用chown 更改所有者解决了这个问题。 感谢您的快速帮助!

【问题讨论】:

    标签: python python-3.x file-permissions treetagger


    【解决方案1】:

    转到包含setup.py 的文件夹并执行sudo chmod -R 777 folder_name。我希望这会有所帮助。

    【讨论】:

    • 太好了,感谢您的建议!实际上不是这个,但后来我注意到该文件具有所有者 root,因此使用 chown 更改所有者解决了问题。也许您可以将此添加到您的答案中,这样也对其他人有所帮助!
    • sudo chmod -R 777 . 为我创造了奇迹
    猜你喜欢
    • 1970-01-01
    • 2017-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-14
    • 1970-01-01
    • 2012-08-18
    • 1970-01-01
    相关资源
    最近更新 更多