首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法从OpenShift的GitHub安装Python模块

无法从OpenShift的GitHub安装Python模块
EN

Stack Overflow用户
提问于 2013-04-06 02:37:20
回答 1查看 1K关注 0票数 1

尝试将Python应用程序部署到OpenShift中,BTW是我的第一个OpenShift部署。一切正常,除了安装托管在GitHub上的模块。我已经尝试过很多方法了。有谁能帮帮我吗?在此之前,非常感谢您。似乎OpenShift Git版本(1.7.1)与我正在尝试实现的目标不兼容。以下是错误输出:

代码语言:javascript
复制
    Obtaining django-filter from git+https://github.com/jpardobl/django-filter.git@8a3d092a99feaacea6b85c5ae5a987dc9ea970ab#egg=django_filter-dev (from -r /var/lib/openshift/515ebbc650044643fa00000d/app-root/repo/requirements.txt (line 1))
remote:   Found command 'git' at '/usr/bin/git'
remote: Command /usr/bin/git config remote.origin.url failed with error code 1
remote: Exception information:
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py", line 126, in main
remote:     self.run(options, args)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/commands/install.py", line 223, in run
remote:     requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/req.py", line 936, in prepare_files
remote:     req_to_install.update_editable(not self.is_download)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/req.py", line 384, in update_editable
remote:     vcs_backend.obtain(self.source_dir)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/vcs/git.py", line 104, in obtain
remote:     if self.check_destination(dest, url, rev_options, rev_display):
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/vcs/__init__.py", line 183, in check_destination
remote:     existing_url = self.get_url(dest)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/vcs/git.py", line 116, in get_url
remote:     show_stdout=False, cwd=location)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/__init__.py", line 255, in call_subprocess
remote:     % (command_desc, proc.returncode))
remote: InstallationError: Command /usr/bin/git config remote.origin.url failed with error code 1
remote: 
remote: Storing complete log in /var/lib/openshift/515ebbc650044643fa00000d/.pip/pip.log
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/bin/pip", line 9, in <module>
remote:     load_entry_point('pip==1.0.2', 'console_scripts', 'pip')()
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/__init__.py", line 116, in main
remote:     return command.main(initial_args, args[1:], options)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py", line 151, in main
remote:     log_fp = open_logfile(log_fn, 'w')
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py", line 177, in open_logfile
remote:     os.makedirs(dirname)
remote:   File "/usr/lib64/python2.6/os.py", line 157, in makedirs
remote:     mkdir(name, mode)
remote: OSError: [Errno 13] Permission denied: '/var/lib/openshift/515ebbc650044643fa00000d/.pip'
remote: Running .openshift/action_hooks/build
remote: Obtaining django-filter from git+https://github.com/jpardobl/django-filter.git@8a3d092a99feaacea6b85c5ae5a987dc9ea970ab#egg=django_filter-dev (from -r /var/lib/openshift/515ebbc650044643fa00000d/app-root/repo/requirements.txt (line 1))
remote:   Found command 'git' at '/usr/bin/git'
remote: Command /usr/bin/git config remote.origin.url failed with error code 1
remote: Exception information:
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py", line 126, in main
remote:     self.run(options, args)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/commands/install.py", line 223, in run
remote:     requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/req.py", line 936, in prepare_files
remote:     req_to_install.update_editable(not self.is_download)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/req.py", line 384, in update_editable
remote:     vcs_backend.obtain(self.source_dir)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/vcs/git.py", line 104, in obtain
remote:     if self.check_destination(dest, url, rev_options, rev_display):
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/vcs/__init__.py", line 183, in check_destination
remote:     existing_url = self.get_url(dest)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/vcs/git.py", line 116, in get_url
remote:     show_stdout=False, cwd=location)
remote:   File "/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/lib/python2.6/site-packages/pip-1.0.2-py2.6.egg/pip/__init__.py", line 255, in call_subprocess
remote:     % (command_desc, proc.returncode))
remote: InstallationError: Command /usr/bin/git config remote.origin.url failed with error code 1

下面是我的setup.py文件

代码语言:javascript
复制
 from setuptools import setup

    setup(name='nautivel', 
version='0.8.1', 
description='OpenShift App', 
author='Javier Pardo Blasco', 
author_email='xxxxxxx', 
url='http://jpardobl.com', 
install_requires=( 
'Django == 1.5', 
'argparse == 1.2.1', 
'distribute == 0.6.24', 
'moment == 0.0.15', ), )

还有我的requirements.txt文件

代码语言:javascript
复制
-e git+https://github.com/jpardobl/django-filter.git@8a3d092a99feaacea6b85c5ae5a987dc9ea970ab#egg=django_filter-dev

最后是.openshift/action_hooks/build文件(它在尝试时没有使用环境变量来降低错误风险)

代码语言:javascript
复制
    !/bin/bash
    source /var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/bin/activate 
/var/lib/openshift/515ebbc650044643fa00000d/python-2.6/virtenv/bin/pip install -v -r /var/lib/openshift/515ebbc650044643fa00000d/app-root/repo/requirements.txt
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-10 15:41:42

我没有使用setup.py进行安装,而是使用了一种变通方法。我从build action钩子安装模块,如下所示。

代码语言:javascript
复制
# .openshift/action_hooks/build


#!/bin/bash
MESSAGES_PATH=$HOME/python-2.6/virtenv/lib/python2.6/site-packages/django-messages-patch-src
git clone git://github.com/jpardobl/django-messages-patched.git $MESSAGES_PATH
ln -s $MESSAGES_PATH/django_messages $HOME/python-2.6/virtenv/lib/python2.6/site-packages/messages

就是这样!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15841148

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档