pip install在OpenShift中失败,错误信息是Permission Denied [英] pip install Failed in OpenShift, the error info is Permission Denied

查看:321
本文介绍了pip install在OpenShift中失败,错误信息是Permission Denied的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用git在OpenShift中推送并重建我的DIY应用程序时,pip安装失败,错误是Permission Denied。有谁知道为什么?



我不知道为什么pip会在 / var / lib / openshift / 513b50c74382ec1582000797 / 路径中写入.pip 。

  remote:构建git ref'master',提交35344b7 
remote:需求已满足(使用--upgrade to升级):./app-root/data/lib/python2.7/site-packages中的Flask == 0.9(从-r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt (第1行))
remote:需求已满足(使用--upgrade升级):markdown in ./app-root/data/lib/python2.7/site-packages(from -r / var / lib /openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt(第2行))
remote:需求已满足(使用--upgrade升级):tornado == 1.2.1 in ./app -root / data / lib / python2.7 / site-packages(从-r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt(第3行))
remote:需求已满足(使用 - 升级升级):uWSGI == 1.4.4 in ./app-root/data/lib/python2.7/site-packages(from -r / var / lib / openshift / 513b50c74382ec1582000797 / app -root /运行/回购//要求。 txt(第4行))
remote:需求已满足(使用--upgrade升级):./app-root/data/lib/python2.7/site-packages中的PyRSS2Gen(从-r / var / lib / openshift / 513b50c74382ec1582000797 / app-root / runtime / repo // requirements.txt(第5行))
remote:需求已满足(使用--upgrade升级):./app-root/data中的pygments /lib/python2.7/site-packages(从-r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt(第6行))
remote:下载/解压缩烧瓶-Cache == 0.13(来自-r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt(第7行))
remote:例外:
remote:Traceback (最近的最后一次呼叫):
remote:File/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/ pip / basecommand.py,第104行,在主
remote:status = self.run(options,args)
remote:File/ var / lib / openshift / 513b50c74382ec1582000797 / app-root / data / lib目录/ python2.7 / site-packages / pip-1.1-py2.7.egg / pip / commands / install.py,第245行,运行
remote:require_set.prepare_files(finder,force_root_egg_info = self.bundle, bundle = self.bundle)
remote:File/ var / lib / opennsh / /req.py,第971行,在prepare_files
remote:location = req_to_install.build_location(self.build_dir,not self.is_download)
remote:File/ var / lib / openshift / 513b50c74382ec1582000797 / app -root / data / lib / python2.7 / site-packages / pip-1.1-py2.7.egg / pip / req.py,第153行,在build_locatio中
remote:_make_build_dir(build_dir)
remote:File/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py,第1225行,在_make_build_dir
remote:os.makedirs(build_dir)
remote:File/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/os.py,第157行,在makedirs
r emote:mkdir(名称,模式)
remote:OSError:[Errno 13]权限被拒绝:'/ var / lib / openshift / 513b50c74382ec1582000797 / build'
remote:
remote:存储完整日志in /var/lib/openshift/513b50c74382ec1582000797/.pip/pip.log
remote:Traceback(最近一次调用最后一次):
remote:File/ var / lib / openshift / 513b50c74382ec1582000797 / app-root / data // bin / pip,第8行,在< module>
remote:load_entry_point('pip == 1.1','console_scripts','pip')()
remote:File/ var / lib / openshift / 513b50c74382ec1582000797 / app-root / data / lib / python2.7 / site-packages / pip-1.1-py2.7.egg / pip / __ init__.py,第116行,在主
remote:return command.main(args [1:],options)
remote:File/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py,行141,在主
remote:log_fp = open_logfile(log_fn,'w')
remote:File/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site /var/lib/pip-1.1-py2.7.egg/pip/basecommand.py,第165行,在open_logfile中
remote:os.makedirs(dirname)
remote:File/ var / lib / (名称,模式)
remote:OSError:[Errno 13]:
remote:mkdir(名称,模式)openshift / 513b50c74382ec1582000797 / app-root / data / lib / python2.7 / os.py Permission denied:'/var/lib/openshift/513b50c74382ec1582000797/.pip'
remote:执行'gear postreceive'(退出代码:1)时发生错误
remote:错误消息:CLIENT_ERROR:无法为513b50c74382ec1582000797应用程序执行动作钩'build'py27
remote:
remote:有关该问题的更多详细信息,请尝试使用'--trace'选项再次运行该命令。


解决方案

看起来像默认的pip安装会尝试写入一些信息放入您的主目录,您无权在openshift上写入。您是否尝试过使用其中一种预建的python墨盒?他们被设置为正确安装您在应用程序中定义的软件包。



如果您在使用DIY设备时已经死了,您至少应该查看默认python墨盒,并看看他们如何解决这个相同的问题: https://github.com / openshift / origin-server / tree / master / cartridge

when I git push and rebuild my DIY application in OpenShift, the pip install failed, and the error is Permission Denied. does any one know why ?

I have no idea why pip will write the .pip in /var/lib/openshift/513b50c74382ec1582000797/ path.

remote: Building git ref 'master', commit 35344b7
remote: Requirement already satisfied (use --upgrade to upgrade): Flask==0.9 in ./app-root/data/lib/python2.7/site-packages (from -r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt (line 1))
remote: Requirement already satisfied (use --upgrade to upgrade): markdown in ./app-root/data/lib/python2.7/site-packages (from -r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt (line 2))
remote: Requirement already satisfied (use --upgrade to upgrade): tornado==1.2.1 in ./app-root/data/lib/python2.7/site-packages (from -r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt (line 3))
remote: Requirement already satisfied (use --upgrade to upgrade): uWSGI==1.4.4 in ./app-root/data/lib/python2.7/site-packages (from -r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt (line 4))
remote: Requirement already satisfied (use --upgrade to upgrade): PyRSS2Gen in ./app-root/data/lib/python2.7/site-packages (from -r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt (line 5))
remote: Requirement already satisfied (use --upgrade to upgrade): pygments in ./app-root/data/lib/python2.7/site-packages (from -r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt (line 6))
remote: Downloading/unpacking Flask-Cache==0.13 (from -r /var/lib/openshift/513b50c74382ec1582000797/app-root/runtime/repo//requirements.txt (line 7))
remote: Exception:
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
remote:     status = self.run(options, args)
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 245, in run
remote:     requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 971, in prepare_files
remote:     location = req_to_install.build_location(self.build_dir, not self.is_download)
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 153, in build_locatio
remote:     _make_build_dir(build_dir)
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1225, in _make_build_dir
remote:     os.makedirs(build_dir)
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/os.py", line 157, in makedirs
remote:     mkdir(name, mode)
remote: OSError: [Errno 13] Permission denied: '/var/lib/openshift/513b50c74382ec1582000797/build'
remote: 
remote: Storing complete log in /var/lib/openshift/513b50c74382ec1582000797/.pip/pip.log
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data//bin/pip", line 8, in <module>
remote:     load_entry_point('pip==1.1', 'console_scripts', 'pip')()
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/__init__.py", line 116, in main
remote:     return command.main(args[1:], options)
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 141, in main
remote:     log_fp = open_logfile(log_fn, 'w')
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 165, in open_logfile
remote:     os.makedirs(dirname)
remote:   File "/var/lib/openshift/513b50c74382ec1582000797/app-root/data/lib/python2.7/os.py", line 157, in makedirs
remote:     mkdir(name, mode)
remote: OSError: [Errno 13] Permission denied: '/var/lib/openshift/513b50c74382ec1582000797/.pip'
remote: An error occurred executing 'gear postreceive' (exit code: 1)
remote: Error message: CLIENT_ERROR: Failed to execute action hook 'build' for 513b50c74382ec1582000797 application py27
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.

解决方案

looks like pip install by default tries to write some information into your home directory, which you don't have access to write to on openshift. Have you tried using one of the pre-built python cartridges? They are setup to correctly install packages that you define within your application.

If you are dead set on using a DIY gear, you might at least look at the code for the default python cartridges and see how they solve this same issue: https://github.com/openshift/origin-server/tree/master/cartridges

这篇关于pip install在OpenShift中失败,错误信息是Permission Denied的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆