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. 使用 FileZilla FTP Client连接Vsftpd在执行LIST命令后提示连接超时

    使用 FileZilla FTP Client 连接 Vsftpd在执行LIST命令后提示连接超时. vi /etc/vsftpd/vsftpd.conf 添加: #开启被动模式 pasv_enabl ...

  2. 安装LINUX X86-64的10201出现链接ins_ctx.mk错误

    在安装linux X86-64的Oracle10201时,在链接过程中出现了这个错误. 详细错误信息为: Error in invoking target ‘install’ of makefile  ...

  3. centos6.5网络配置问题:ping不通

    遇到的问题:win7网卡ping不通 win7中的VMnet8信息 centos6.5设置: /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ...

  4. The Ninth Hunan Collegiate Programming Contest (2013) Problem L

    Problem L Last Blood In many programming contests, special prizes are given to teams who solved a pa ...

  5. android Json 解析和生成

    什么是json: JSON即JavaScript Object Natation的简称,它是一种轻量级的数据交换格式,非常适合服务器与JavaScript的交互.JSON易于人阅读和编写.同时也易于机 ...

  6. 初探接口测试框架--python系列2

    点击标题下「蓝色微信名」可快速关注 坚持的是分享,搬运的是知识,图的是大家的进步,没有收费的培训,没有虚度的吹水,喜欢就关注.转发(免费帮助更多伙伴)等来交流,想了解的知识请留言,给你带来更多价值,是 ...

  7. ODCA最佳实践翻译:Architecting Cloud-Aware Applications (一)

    Architecting Cloud-Aware Applications ** ODCA(Open Data Center Alliance)最佳实践 ** MagicBowen(e.bowen.w ...

  8. Jquery 对象与 DOM对象的相互转换

    在做 web 开发时,经常会用到 jquery 和 dom 对象, 有时候需要在这两个对象间进行切换. Jquery 对象 就是通过jQuery包装DOM对象后产生的对象.jQuery对象是jQuer ...

  9. ios项目记录

    1,如何隐藏状态栏 在基类中重载UIViewController.h中的这个方法 - (BOOL)prefersStatusBarHidden { // iOS7后,[[UIApplication s ...

  10. ostack