当我在OpenShift中推送并重建我的DIY应用程序时,pip安装失败,错误是Permission Denied。有人知道为什么吗?
我不知道为什么pip会在/var/lib/openshift/513b50c74382ec1582000797/
路径中写入.pip。
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.
答案 0 :(得分:0)
看起来像pip install默认尝试将一些信息写入您的主目录,而您无权在openshift上写入。您是否尝试过使用其中一个预制的python磁带?它们设置为正确安装您在应用程序中定义的包。
如果你已经开始使用DIY设备,你至少可以查看默认python磁带的代码,看看他们如何解决这个问题:https://github.com/openshift/origin-server/tree/master/cartridges