Red Hat Bugzilla – Bug 1300356
Can not install lxml to OpenShift online
Last modified: 2016-03-04 09:26:17 EST
Description of problem:
I was able to install lxml in the past, but lately I wanted to move to a scalable app and I simply can not find a way to install lxml on OpenShift Online.
pip install lxml or easy_install lxml
Connection to app-nick.rhcloud.com closed by remote host.
Connection to app-nick.rhcloud.com closed.
I described my problem to stackoverflow - http://stackoverflow.com/questions/34900300/install-lxml-on-openshift-with-python-packages-only-pip-easy-install
Based on comments in stackoverflow I should have mentioned that I use Python 2.7. Lxml with Python 3 is probably working fine.
I understand that one of our engineers Maciej has already been in contact with you to suggest the solution for your issue. I just want to restate it here for the record. Instead of ssh-ing to the gear and then manually pip install lxml, you should modify the requirements.txt file and add the lxml package. Just simply add "lxml==3.4.4" or whichever version you need to the file and then perform a git push (git add . && git commit -am "Install lxml" && git push). The lxml package should be installed properly for your app.
Hi, yes he was in contact with me. However installing with requirements.txt file is same as pip, so it did not work. I do know know what was the problem, but Maciej suggested re-creating app from scratch and that worked. In newly created app I was able to run "pip install lxml" successfully. Weird error and I am sorry there is not a better solution. Thanks for help!
Thanks for a quick update and not a problem at all. Sometimes, it's just a glitch somewhere. I'm glad that everything is working for you.
Thanks again for letting us know.
I am having the same issue, I cannot install lxml for a python 3.3 app.
I have tried several times to create an app from scratch but it does not change anything.
I described my problem on stackoverflow:
I have tried using the requirements file.
I have also tried to ssh into the app and manually do a pip install lxml after activating the virtual env but it does not work either.
I am able to install other libraries. The problem happens only for lxml.
Thanks for your help.
Quick update, it seems that it's only the latest version of lxml (3.5.0) that does not work.
It works using `lxml==3.4.4`.
Sorry for the delay. It looks like the newest version of lxml (3.5.0) requires more memory which exceeds the 512 MB provided with small gear and it adds more features into the packages. As a result, that version can only be installed in medium gear or bigger unfortunately. So, I would recommend you to keep using 3.4.4 version if you plan to use small gear for your deployment.
Also, do you plan to update python 3.3?
The current version is 3.3.2 and the latest 3.3 version is 3.3.6 which includes some bug fixes like for example for makedirs:
Otherwise, do you plan to add python 3.5.1?
As far as I can recall, we don't have any plans to upgrade the Python-3.3 cartridge nor release a Python-3.5 cartridge unfortunately.
However, technically speaking, you can create your own custom cartridge if you wish to do so. You can take a look at this link:
Or feel free to google it out too :).
There is a repo I found that utilizes Python 3.3 even it's embedded cartridge, not a wed framework cartridge: Here is the link:
Also, I would recommend you to check out the new Openshift V3 at openshift/origin on github as well.
Anyway, if you have any further questions that aren't directly related to this bug, please create an issue in github for openshift/origin-server. It's quicker for us to answer your questions over there than here since this bug is closed.
A typo on previous comment, I meam "There is a repo I found that utilizes Python 3.5 even it's embedded cartridge..."
Sorry about that.
The repo above for a Python 3.5 cartridge does not work.
Would it be possible to get the source code of the Python-3.3 cartridge to adapt it to use Python 3.5 instead of starting from scratch?
Where can I find the Python3.3 cartridge code?
I would appreciate if you can post your questions on GitHub openshift/origin-server instead as the bug is now closed. Bugzilla is not intended for QA so we certainly want to avoid unrelated comments on the bug.
You can look at the code for python cartridge under openshift/origin-server/cartridges. However, unless you install OpenShift on your own system then you can change the code of python cartridge and build an rpm and then install it yourself. Otherwise, if you use OpenShift Online from our website then you can't do so. The only way to do that is to build the code from github and create a new app with Python 3.5 from there.