openshift:Perhaps your account does not have write access to this directory? You can change the cac
2013-01-03 00:00
736 查看
添加了pymongo之后重新部署程序,openshift 出现如下错误
分析原因是访问了某个不被允许的目录,由于使用的virtenv管理包,在openshift启动的时候已经设置了这项的值:
最后原因是需要在引用某些模块之前设置这个变量:
将后面的模块导入改下顺序就可以了。
File "/var/lib/openshift/0f9c019e8890400bb48af288d0307389/app-root/runtime/repo//diy/runapp.py", line 5, in <module> from application import Application File "/var/lib/openshift/0f9c019e8890400bb48af288d0307389/app-root/runtime/repo/diy/application.py", line 7, in <module> import dbhelper File "/var/lib/openshift/0f9c019e8890400bb48af288d0307389/app-root/runtime/repo/diy/dbhelper/__init__.py", line 5, in <module> from dbhelper import * File "/var/lib/openshift/0f9c019e8890400bb48af288d0307389/app-root/runtime/repo/diy/dbhelper/dbhelper.py", line 4, in <module> from pymongo import MongoClient File "build/bdist.linux-x86_64/egg/pymongo/__init__.py", line 61, in <module> File "build/bdist.linux-x86_64/egg/pymongo/connection.py", line 39, in <module> File "build/bdist.linux-x86_64/egg/pymongo/mongo_client.py", line 44, in <module> File "build/bdist.linux-x86_64/egg/bson/__init__.py", line 41, in <module> File "build/bdist.linux-x86_64/egg/bson/_cbson.py", line 7, in <module> File "build/bdist.linux-x86_64/egg/bson/_cbson.py", line 4, in __bootstrap__ File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 882, in resource_filename The exception instance that caused extraction to fail File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1351, in get_resource_filename File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1373, in _extract_resource # Convert a zipfile subpath into an egg-relative path part list File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 962, in get_cache_path File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 928, in extraction_error 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: '/var/lib/openshift/0f9c019e8890400bb48af288d0307389/.python-eggs' The Python egg cache directory is currently set to: /var/lib/openshift/0f9c019e8890400bb48af288d0307389/.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.
分析原因是访问了某个不被允许的目录,由于使用的virtenv管理包,在openshift启动的时候已经设置了这项的值:
here = os.path.dirname(os.path.abspath(__file__)) os.environ['PYTHON_EGG_CACHE'] = os.path.join(here, '..', 'misc/virtenv/lib/python2.7/site-packages') virtualenv = os.path.join(here, '..', 'misc/virtenv/bin/activate_this.py') execfile(virtualenv, dict(__file__=virtualenv))
最后原因是需要在引用某些模块之前设置这个变量:
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from setting import *
import os
here = os.path.dirname(os.path.abspath(__file__)) os.environ['PYTHON_EGG_CACHE'] = os.path.join(here, '..', 'misc/virtenv/lib/python2.7/site-packages') virtualenv = os.path.join(here, '..', 'misc/virtenv/bin/activate_this.py') execfile(virtualenv, dict(__file__=virtualenv))
from application import Application
import tornado.options
import tornado.httpserver
import tornado.ioloop
将后面的模块导入改下顺序就可以了。
相关文章推荐
- 故障解决:Failure adding assembly to the cache: Access denied. You might not have administrative credentials to perform this task. Contact your system administrator for assistance.
- how to solve the problem when you have chmod the directory to 777 but the apache still can not write file
- 启动WCF服务时出现WCF Error: HTTP could not register URL http://+:xxxx/... Your process does not have access rights to this namespace
- The current identity (NT AUTHORITY/NETWORK SERVICE) does not have write access to 'C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319
- This App does not have access to your photos or videos in iOS 9
- HTTP could not register URL http://+:****/WCFService/. Your process does not have access rights to this namespace
- TF31003: Your user account does not have permsision to connect to the team foundation server xxx. Contact your team foun
- The current identity (JSTAM2\jstcrm) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framewo
- [magento]Warning: Your Magento folder does not have sufficient write permissions. If you wish to pro
- HTTP could not register URL http://+:8000/testservice/. Your process does not have access rights to this namespace 解决方案
- The current identity ( XXXX) does not have write access to ‘C:\Windows\Microsoft.NET\Framework\v4.0.
- "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."
- Unable to access the IIS metabase.You do not have sufficient privilege
- Unable to locate the server named "localhost" --- the server does not have a DNS entry. Perhaps ther
- Unable to access the IIS metabase.You do not have sufficient privilege
- The security key for this program currently stored on your system does not appear to be valid for th
- android.content.ActivityNotFoundException: Unable to find explicit activity class {...}; have you declared this activity in your AndroidManifest.xml?
- runInstaller-- you do not have sufficient permissions to access the inventory
- This server could not verify that you are authorized to access the document requested.
- Unable to access the IIS metabase.You do not have sufficient privilege