【问题标题】:.python-eggs permission denied.python-eggs 权限被拒绝
【发布时间】:2011-08-31 14:48:31
【问题描述】:

尝试使用 Django 创建简单数据库时出现以下错误。我是这台计算机上唯一的用户,所以我应该是管理员。我该如何做才能让我拥有权限,以便 Django 可以做它的事情?

这里还有一些错误:

[Errno 13] Permission denied: '/Users/tyre77/.python-eggs/simplejson-2.1.6-py2.7-macosx-10.7-intel.egg-tmp/simplejson/tmpUxM60A.$extract'

The Python egg cache directory is currently set to:

/Users/tyre77/.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

【问题讨论】:

  • ls -l /Users/tyre77/.python-eggs/ls -l /Users/tyre77/.python-eggs/simplejson-2.1.6-py2.7-macosx-10.7-intel.egg-tmp/ 的结果是什么?
  • 第一个:总共 0 drwxr-xr-x 3 根员工 102 Aug 30 20:58 simplejson-2.1.6-py2.7-macosx-10.7-intel.egg-tmp跨度>
  • "我是这台计算机上唯一的用户,所以我应该是管理员。"使用“管理员”帐户不会授予您对整个文件系统的写入权限,它只会让您使用 sudo 获得 root 访问权限。始终使用具有完全访问权限的普通用户帐户存在巨大的安全风险。
  • 第二个:total 0 drwxr-xr-x 3 root staff 102 Aug 30 20:58 simplejson

标签: python database django terminal


【解决方案1】:

文件似乎由 root 拥有,小组工作人员无权写入这些文件/目录,而且您不是 root。

尝试更改这些文件的所有者:sudo chown -R tyre77 /Users/tyre77/.python-eggs/

也许您已经使用 sudo 命令安装了模块,因此文件是使用 root 权限创建的。

【讨论】:

  • 我想我确实必须使用 sudo 安装,否则它拒绝了我,但现在我得到了这个错误 chown: /Users/tyre77/.python-eggs/: Operation not allowed
  • @Chris :即使使用 sudo 运行 chown ?哦,可能是args的顺序不对,试试:sudo chown -R tyre77 /Users/tyre77/.python-eggs/
猜你喜欢
  • 1970-01-01
  • 2017-10-28
  • 1970-01-01
  • 1970-01-01
  • 2017-04-20
  • 2021-05-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多