Install python packages on OpenShift

℡╲_俬逩灬. 提交于 2019-11-28 01:14:30

Did you install rhc (made by OpenShift.com) ?
If not then see on OpenShift.com: Installing OpenShift RHC Client Tools

Now you can access server with rhc

rhc ssh

and then you can do as always:

checking python version (with big V)

python -V

checking pip version (with big V)

pip -V

checking installed modules

pip freeze

searching module

pip search simplejson

pip search json | sort # sorted result

installing new module

pip install simplejson

and other linux/bash functions

ls
ls -al
echo "hello world"
cd folder_name
mkdir new_folder_name
chmod +x filename
cat filename
grep 'hello' */*.py
history
nano filename
for x in */* ; do echo $x ; done

Trying to install Python libraries via pip always results in OSError: [Errno 13] Permission denied errors for me. Not sure if this is a change in OpenShift behavior or a some misconfiguration on my part. For anyone else who has issues installing via pip, easy_install consistently works for me (at least with the Flask cartridge):

[appname-domain.rhcloud.com ]\> easy_install simplejson
Searching for simplejson
Best match: simplejson 3.2.0
Adding simplejson 3.2.0 to easy-install.pth file

Using /opt/rh/python27/root/usr/lib64/python2.7/site-packages
Processing dependencies for simplejson
Finished processing dependencies for simplejson
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!