openshift python pip install cffi 失败

openshift python pip install cffi fails

在 git 推送到 openshift 存储库后部署应用程序时 requirements.txt 开始安装时出现错误。

问题是,在我的本地机器上执行 pip install cffi

时没有问题
remote: Requirement already satisfied (use --upgrade to upgrade): aniso8601==0.92 in /var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 1))
remote: Downloading/unpacking apns-client==0.2.1 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 2))
remote:   Downloading apns-client-0.2.1.tar.gz
remote:   Running setup.py egg_info for package apns-client
remote:     
remote: Downloading/unpacking cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3))
remote:   Could not find a version that satisfies the requirement cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3)) (from versions: 0.1, 0.2.1, 0.2, 0.3, 0.4.1, 0.4.2, 0.4, 0.5, 0.6, 0.7.1, 0.7.2, 0.7, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8)
remote: Cleaning up...
remote: No distributions matching the version for cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3))
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/myuser/python/virtenv/bin/pip", line 12, in <module>
remote:     load_entry_point('pip==1.4', 'console_scripts', 'pip')()
remote:   File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/__init__.py", line 147, in main
remote:     return command.main(args[1:], options)
remote:   File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 171, in main
remote:     log_fp = open_logfile(log_fn, 'w')
remote:   File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 200, in open_logfile
remote:     os.makedirs(dirname)
remote:   File "/var/lib/openshift/myuser/python/virtenv/lib64/python2.7/os.py", line 157, in makedirs
remote:     mkdir(name, mode)
remote: OSError: [Errno 13] Permission denied: '/var/lib/openshift/myuser/.pip'

同样的事情发生在 pip isntall cryptographypyOpenSSL

我终于修好了。 通过 ssh

连接
rhc ssh -a myapp

连接后,我像往常一样使用 pip

pip install cffi
pip install cryptography
pip install pyOpenSSL