openshift:无法为python应用程序安装lxml [英] openshift: can't install lxml for python app

查看:141
本文介绍了openshift:无法为python应用程序安装lxml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试Openshift,但我无法使用 lxml 部署python应用程序。



以下是我的步骤,我只添加 lxml 要求。错误发生在我推送时。



我能够ssh,所以我不认为这是连接问题。



如果我不添加lxml要求,但添加了一些其他库,它可以工作。



问题仅在于lxml。我认为这是因为它具有一些系统依赖性(我必须在ubuntu机器上运行此命令: sudo apt-get install -y libxml2-dev libxslt-dev python-dev



然而我不认为我可以为openshift应用程序做这件事。有没有办法安装lxml呢?






命令

  rhc app创建testlxml python-3.3 
echo'lxml'> testlxml / requirements.txt
cd testlxml
git add。
git commit -m添加lxml要求
git push

结果:

  vagrant @ dev:〜$ rhc app创建testlxml python-3.3 
RSA 1024位CA证书由于旧的openssl兼容性
应用程序选项
-------------------
域:mikep
盒式磁带:python-3.3
Gear Size:default
Scaling:no

创建应用程序'testlxml'...完成


等待您的DNS名称可用...完成

克隆到'testlxml'中...
警告:将IP地址'54 .84.57.1​​64'的RSA主机密钥永久添加到已知主机列表中。

您的应用程序'testlxml'现在可用。

URL:http://testlxml-mikep.rhcloud.com/
SSH to:56c8e1a789f5cf57a3000116@testlxml-mikep.rhcloud.com
Git remote:ssh:// 56c8e1a789f5cf57a3000116 @ testlxml-mikep.rhcloud.com /〜/ git / testlxml.git /
克隆到:/ home / vagrant / testlxml

运行'rhc show-app testlxml'了解更多关于你的应用。

vagrant @ dev:〜$ echo'lxml'> testlxml / requirements.txt
vagrant @ dev:〜$ cd testlxml
vagrant @ dev:〜/ testlxml $ git add。
vagrant @ dev:〜/ testlxml $ git status
在分支主机
上你的分支是'origin / master'的最新版本。

要提交的更改:
(使用git reset HEAD< file> ...停用)

修改:requirements.txt

vagrant @ dev:〜/ testlxml $ git commit -m添加lxml要求
[master c1776a9]添加lxml要求
1个文件已更改,1个插入(+)

vagrant @ dev:〜/ testlxml $ git push
警告:push.default未设置;它的隐含价值在
Git 2.0中从匹配变为简单。要压制此消息
并在默认更改后维护当前行为,请使用:

git config --global push.default匹配

若要压制此消息并现在采用新的行为,使用:

git config --global push.default简单

当push.default设置为'匹配'时,git将推送本地分支
到已存在的具有相同名称的远程分支。

在Git 2.0中,Git将默认使用更保守的'简单'
行为,它只将当前分支推送到相应的'git pull'使用的
远程分支更新当前分支。

请参阅'git help config'并搜索'push.default'以获取更多信息。
(简单模式在Git 1.7.11中引入)如果您有时使用旧版本的Git,请使用类似模式
'current'而不是'simple'

计数对象:5,完成。
使用多达4个线程的增量压缩。
压缩对象:100%(2/2),完成。
写入对象:100%(3/3),270字节| 0字节/秒,完成。
总计3(增量1),重用0(增量0)
远程:停止Python 3.3盒
远程:等待停止完成
远程:等待停止完成
remote:构建git ref'master',提交c1776a9
remote:激活virtenv
remote:检查在requirements.txt文件中列出的pip依赖项..
remote:目录'/ var / lib / openshift / 56c8e1a789f5cf57a3000116 / .cache / pip / http'或其父目录不属于当前用户,并且缓存已被禁用。请检查该目录的权限和所有者。如果用sudo执行pip,你可能需要sudo的-H标志。
remote:目录'/var/lib/openshift/56c8e1a789f5cf57a3000116/.cache/pip'或其父目录不属于当前用户,并且缓存轮已禁用。检查该目录的权限和所有者。如果用sudo执行pip,你可能需要sudo的-H标志。
remote:收集lxml(从-r /var/lib/openshift/56c8e1a789f5cf57a3000116/app-root/runtime/repo/requirements.txt(第1行))
remote:正在下载http:// mirror1。 ops.rhcloud.com/mirror/python/web/packages/source/l/lxml/lxml-3.5.0.tar.gz(3.8MB)
remote:安装收集的软件包:lxml
remote:为lxml运行setup.py install:启动
连接到由远程主机关闭的testlxml-mikep.rhcloud.com。
致命:远程端意外挂起
错误:边带解复用器出错
至ssh://56c8e1a789f5cf57a3000116@testlxml-mikep.rhcloud.com/~/git/testlxml.git/
cfd1b36..c1776a9 master - > master
错误:无法将一些文件推送到'ssh://56c8e1a789f5cf57a3000116@testlxml-mikep.rhcloud.com/~/git/testlxml.git/'

解决方案

解决方案:



最新版本的 lxml 3.5.0 )不起作用,但 lxml == 3.4.4 作品。


I am trying Openshift but I can't deploy a python app with lxml.

Below are my steps, I'm only adding a lxml requirement. The error happens when I push.

I am able to ssh so I don't think it's a problem of connectivity.

If I don't add the lxml requirement but add some other libraries, it works.

The problem is with lxml only. I think it's because it has some system dependencies (I have to run this on a ubuntu machine before: sudo apt-get install -y libxml2-dev libxslt-dev python-dev)

However I don't think I can do this for an openshift app. Is there no way to install lxml then?


Commands

rhc app create testlxml python-3.3
echo 'lxml' > testlxml/requirements.txt
cd testlxml
git add .
git commit -m "Add lxml requirement"
git push

Result:

vagrant@dev:~$ rhc app create testlxml python-3.3
RSA 1024 bit CA certificates are loaded due to old openssl compatibility
Application Options
-------------------
Domain:     mikep
Cartridges: python-3.3
Gear Size:  default
Scaling:    no

Creating application 'testlxml' ... done


Waiting for your DNS name to be available ... done

Cloning into 'testlxml'...
Warning: Permanently added the RSA host key for IP address '54.84.57.164' to the list of known hosts.

Your application 'testlxml' is now available.

  URL:        http://testlxml-mikep.rhcloud.com/
  SSH to:     56c8e1a789f5cf57a3000116@testlxml-mikep.rhcloud.com
  Git remote: ssh://56c8e1a789f5cf57a3000116@testlxml-mikep.rhcloud.com/~/git/testlxml.git/
  Cloned to:  /home/vagrant/testlxml

Run 'rhc show-app testlxml' for more details about your app.

vagrant@dev:~$ echo 'lxml' > testlxml/requirements.txt
vagrant@dev:~$ cd testlxml
vagrant@dev:~/testlxml$ git add .
vagrant@dev:~/testlxml$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   requirements.txt

vagrant@dev:~/testlxml$ git commit -m "Add lxml requirement"
[master c1776a9] Add lxml requirement
 1 file changed, 1 insertion(+)

vagrant@dev:~/testlxml$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 270 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Stopping Python 3.3 cartridge
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Building git ref 'master', commit c1776a9
remote: Activating virtenv
remote: Checking for pip dependency listed in requirements.txt file..
remote: The directory '/var/lib/openshift/56c8e1a789f5cf57a3000116/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
remote: The directory '/var/lib/openshift/56c8e1a789f5cf57a3000116/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
remote: Collecting lxml (from -r /var/lib/openshift/56c8e1a789f5cf57a3000116/app-root/runtime/repo/requirements.txt (line 1))
remote:   Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/l/lxml/lxml-3.5.0.tar.gz (3.8MB)
remote: Installing collected packages: lxml
remote:   Running setup.py install for lxml: started
Connection to testlxml-mikep.rhcloud.com closed by remote host.
fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer
To ssh://56c8e1a789f5cf57a3000116@testlxml-mikep.rhcloud.com/~/git/testlxml.git/
   cfd1b36..c1776a9  master -> master
error: failed to push some refs to 'ssh://56c8e1a789f5cf57a3000116@testlxml-mikep.rhcloud.com/~/git/testlxml.git/'

解决方案

Solution:

The latest version of lxml (3.5.0) does not work but lxml==3.4.4 works.

这篇关于openshift:无法为python应用程序安装lxml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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