簡體   English   中英

openshift:無法為python應用安裝lxml

[英]openshift: can't install lxml for python app

我正在嘗試Openshift,但無法使用lxml部署python應用程序。

以下是我的步驟,我僅添加一個lxml要求。 當我按下時發生錯誤。

我可以使用ssh,所以我認為這不是連接問題。

如果我不添加lxml要求,但添加其他一些庫,則可以使用。

問題僅在於lxml。 我認為這是因為它具有一些系統依賴性(我必須在ubuntu機器上運行它: sudo apt-get install -y libxml2-dev libxslt-dev python-dev

但是我不認為我可以為openshift應用程序做到這一點。 那有沒有辦法安裝lxml?


命令

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

結果:

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/'

我上次檢查時,Openshift僅能編譯/安裝“ lxml == 3.2.5”。

將setup.py中的“ requires”設置為“ lxml == 3.2.5”。

解:

lxml3.5.0 )的最新版本不起作用,但是lxml==3.4.4起作用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM