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. Traceback (most recent call last):
File "/data/wap/www/spider/picture.py", line 8, in ?
import MySQLdb, datetime, time
File "build/bdist.linux-x86_64/egg/MySQLdb/__init__.py", line 19, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in ?
File "build/bdist.linux-x86_64/egg/_mysql.py", line 4, in __bootstrap__
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 881, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1351, in get_resource_filename
self._extract_resource(manager, self._eager_to_zip(name))
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1372, in _extract_resource
real_path = manager.get_cache_path(
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 962, in get_cache_path
self.extraction_error()
File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 928, in extraction_error
raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache The following error occurred while trying to extract file(s) to the Python egg
cache: [Errno 13] Permission denied: '/root/.python-eggs' The Python egg cache directory is currently set to: /root/.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.

  上面错误是我在php执行python脚本的时候出现的问题:

解决办法是在开始的文件前面加上了这段代码

import os,sys

os.environ['PYTHON_EGG_CACHE'] = '/tmp/.python-eggs'
abspath = os.path.dirname(__file__)
sys.path.append(abspath)
os.chdir(abspath)

  

参考链接:http://blog.blankyao.com/story/solve-python_egg_cache.html

关于PYTHON_EGG_CACHE无权限的问题的更多相关文章

  1. Win32 OpenProcess打开进程失败,返回5无权限操作

    Win32 OpenProcess打开进程失败,返回5无权限操作,相信你会碰到这样的事,在IDE中可以,单独却不可以了,其实这时就需要提权了,否则是无法打开的,OpenProcess提权至Debug即 ...

  2. 微信支付(APP)集成时碰到的问题(.net提示“无权限”、iOS跳转到微信支付页面中间只有一个“确定”按钮)

    直入主题之前,请容我吐槽一下微*的官方东西:ASDFQ%#$%$#$%^FG@#$%DSFQ#$%.......:吐槽玩了!大家心照就好. 要完成手机APP跳转到微信的APP进行微信支付,需要进行如下 ...

  3. tomcat登陆WEB显示无权限问题&& tomcat无限循环启动问题

    tomcat登陆WEB显示无权限问题 The user specified as a definer (”@’%') does not exist 原因分析 因为创建视图使用的是xff@%用户(目前已 ...

  4. 以管理员身份运行 cmd 删除无权限删除的文件夹

    rd 文件夹 PS:删除空文件夹 rd /s 文件夹 PS:删除文件夹,及所有子目录和文件 rd /s/q 文件夹 PS:强制删除文件夹,及所有子目录和文件,不需要提示

  5. centos7上 docket无权限的问题

    2.4 centos7上 docket无权限的问题,解决方案: https://stackoverflow.com/questions/24288616/permission-denied-on-ac ...

  6. Linux无权限上传文件解决办法

    无权限上传文件解决办法 1.当前登录的普通用户:user1/password1 2.切换到管理员(user2)用户: sudo su - user2 输入user2用户的密码:password2 或者 ...

  7. windows 邮槽mailslot 在服务程序内建立后客户端无权限访问(GetLastError() == 5)的问题

    邮槽创建在服务程序内,可以创建成功, 但外部客户端连接时 m_hMailslot = CreateFile("\\\\.\\mailslot\\zdpMailslot",GENER ...

  8. XP局域网访问无权限、不能互相访问问题的完整解决方案

    XP局域网访问无权限问题的完整解决方案: 1:用管理员账户登录系统 2:在“开始”-- “运行”里输入 GPEDIT.MSC 目的是打开组策略选项 3:依次展开”WINDOWS设置”-”本地策略”-” ...

  9. ORA-01950: no privileges on tablespace xxx ORA-01950: 对表空间 'xxx'无权限

    场景: 创建用户,在用户scheme下新建了一张表,插入数据时报错 ORA-01950: 对表空间 'xxx'无权限 创建用户 /*第1步:创建临时表空间 */ create temporary ta ...

随机推荐

  1. android github

    Action Bars ActionBarSherlock Extended ActionBar FadingActionBar GlassActionBar v7 appcompat library ...

  2. [DataTable]控件排序事件中用DataView及DataTable排序

    控件排序事件中用DataView及DataTable排序 文章分类:.net编程 在做ASP.NET页面开发时,经常要用到dataset(或者DataTable),绑定到DataGrid或GridVi ...

  3. UI_RD协作开发流程

    1. 背景 由于android端需要进行多屏幕适配,这就给UI&RD之间的沟通产生了一些困难.我下面将会对这两种角色的沟通,说明了一下我们项目中沟通的方式和规则. 原则:客户端跟UI约定了各种 ...

  4. 在点击HOME键时, 在点击icon回到原来的应用。

    参考资料: http://www.linuxidc.com/Linux/2012-01/51332.htm

  5. Fragment和Activity的区别

    Fragment用来描述一些行为或一部分用户界面在一个Activity中,可以合并多个Fragment在一个单独的Activity中建立多个UI面板,同时重用Fragment在多个activity中. ...

  6. Android——学习笔记

    1.this注意 @Override            public void onItemSelected(AdapterView<?> parent, View view,     ...

  7. C#数字图像处理算法学习笔记(三)--图像几何变换

    C#数字图像处理算法学习笔记(三)--图像几何变换 几何图像处理包括 图像的平移变换,镜像变换,旋转变换,伸缩变换,在这里仅以水平镜像为例,通过代码来理解其基本操作方式: 翻转前:

  8. jquery是如何清除ajax缓存的

    大家都知道万恶的IE在ajax中往往只读取第一次ajax请求时候的数据,其余时候都是从cache提取数据,(太懒了T_T).原生的JS清除ajax缓存的方法多,但是终觉有点繁琐,如果是用jquery的 ...

  9. 开机自启动redis

    修改redis.conf,打开后台运行选项: # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note ...

  10. 学习记录 java session保存用户登录

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...