Permission denied: ... .python-eggs

本文介绍了解决Python安装过程中因权限问题无法创建Egg缓存目录的方法。通过配置环境变量PYTHON_EGG_CACHE指向可写目录,适用于Buildout配置及旧版Zope安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

http://plone.org/documentation/error/permission-denied-python-eggs

 

Product installation failure due to failure to create egg cache

Some Python libraries, notably the Python-MySQL library, are distributed in compressed Python eggs that need to be uncompressed into a cache directory.

Unless you specify a target directory for this cache, Python will try to create it in $HOME/.python-eggs. If you're running Zope under a special user id and with mimimum permissions (as you should), Python may not be able to create the cache directory.

Fixing via buildout

Edit your buildout.cfg to add an environment variable specification pointing to the buildout's var directory to the zope2instance section(s). Then, run bin/buildout.

[instance]
recipe = plone.recipe.zope2instance

...

environment-vars =
    PYTHON_EGG_CACHE ${buildout:directory}/var/.python-eggs

Fixing in an old-style install

The easiest way to solve this problem is to edit your Zope startup script (usually bin/zopectl) to specify a writable location for the cache. Look in zopectl for the line:

export PYTHONPATH INSTANCE_HOME SOFTWARE_HOME

and change it to two lines:

PYTHON_EGG_CACHE="$INSTANCE_HOME/var/.python-eggs"
export PYTHONPATH INSTANCE_HOME SOFTWARE_HOME PYTHON_EGG_CACHE

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值